Skip to content

Commit 8a7f39d

Browse files
committed
tes numeric constants
1 parent f538caa commit 8a7f39d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

litellm/constants.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,10 +1056,10 @@
10561056

10571057
# APScheduler Configuration - MEMORY LEAK FIX
10581058
# These settings prevent memory leaks in APScheduler's normalize() and _apply_jitter() functions
1059-
APSCHEDULER_COALESCE = True # collapse many missed runs into one
1060-
APSCHEDULER_MISFIRE_GRACE_TIME = 3600 # ignore runs older than 1 hour (was 120)
1061-
APSCHEDULER_MAX_INSTANCES = 1 # prevent concurrent job instances
1062-
APSCHEDULER_REPLACE_EXISTING = True # always replace existing jobs
1059+
APSCHEDULER_COALESCE = os.getenv("APSCHEDULER_COALESCE", "True").lower() in ["true", "1"] # collapse many missed runs into one
1060+
APSCHEDULER_MISFIRE_GRACE_TIME = int(os.getenv("APSCHEDULER_MISFIRE_GRACE_TIME", 3600)) # ignore runs older than 1 hour (was 120)
1061+
APSCHEDULER_MAX_INSTANCES = int(os.getenv("APSCHEDULER_MAX_INSTANCES", 1)) # prevent concurrent job instances
1062+
APSCHEDULER_REPLACE_EXISTING = os.getenv("APSCHEDULER_REPLACE_EXISTING", "True").lower() in ["true", "1"] # always replace existing jobs
10631063

10641064
DEFAULT_HEALTH_CHECK_INTERVAL = int(
10651065
os.getenv("DEFAULT_HEALTH_CHECK_INTERVAL", 300)

tests/test_litellm/test_constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ def test_all_numeric_constants_can_be_overridden():
2626
constants_attributes = inspect.getmembers(constants)
2727

2828
# Filter for uppercase constants (by convention) that are integers or floats
29+
# Exclude booleans since bool is a subclass of int in Python
2930
numeric_constants = [
3031
(name, value)
3132
for name, value in constants_attributes
32-
if name.isupper() and isinstance(value, (int, float))
33+
if name.isupper() and isinstance(value, (int, float)) and not isinstance(value, bool)
3334
]
3435

3536
# Ensure we found some constants to test

0 commit comments

Comments
 (0)