From cf95db281403e6fba00a24c21274af332fc472d1 Mon Sep 17 00:00:00 2001 From: Kyujin Cho Date: Fri, 29 Nov 2024 08:30:33 +0900 Subject: [PATCH 1/2] fix: program not started when `rotation-size` is set --- changes/.fix.md | 1 + src/ai/backend/logging/types.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changes/.fix.md diff --git a/changes/.fix.md b/changes/.fix.md new file mode 100644 index 0000000000..c043ecb8c6 --- /dev/null +++ b/changes/.fix.md @@ -0,0 +1 @@ +Fix service not started when `[logging].rotation-size` config is set diff --git a/src/ai/backend/logging/types.py b/src/ai/backend/logging/types.py index 57ad25ab23..44a37e1578 100644 --- a/src/ai/backend/logging/types.py +++ b/src/ai/backend/logging/types.py @@ -124,8 +124,10 @@ class SimpleBinarySizeTrafaret(t.Trafaret): } endings = ("ibytes", "ibyte", "ib", "bytes", "byte", "b") - def check_and_return(self, value: str) -> int: + def check_and_return(self, value: str | int) -> int: orig_value = value + if isinstance(value, int): + return value value = value.strip().replace("_", "") try: return int(value) From 56605c58969efaa8e7a0a18727b90a276eb5488e Mon Sep 17 00:00:00 2001 From: Kyujin Cho Date: Fri, 29 Nov 2024 08:35:51 +0900 Subject: [PATCH 2/2] add news fragment --- changes/{.fix.md => 3174.fix.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changes/{.fix.md => 3174.fix.md} (100%) diff --git a/changes/.fix.md b/changes/3174.fix.md similarity index 100% rename from changes/.fix.md rename to changes/3174.fix.md