tes numeric constants

This commit is contained in:
Ishaan Jaffer
2025-10-29 18:23:38 -07:00
parent f538caaa01
commit 8a7f39daa4
2 changed files with 6 additions and 5 deletions

View File

@@ -1056,10 +1056,10 @@ PROXY_BATCH_WRITE_AT = int(os.getenv("PROXY_BATCH_WRITE_AT", 30)) # in seconds,
# APScheduler Configuration - MEMORY LEAK FIX
# These settings prevent memory leaks in APScheduler's normalize() and _apply_jitter() functions
APSCHEDULER_COALESCE = True # collapse many missed runs into one
APSCHEDULER_MISFIRE_GRACE_TIME = 3600 # ignore runs older than 1 hour (was 120)
APSCHEDULER_MAX_INSTANCES = 1 # prevent concurrent job instances
APSCHEDULER_REPLACE_EXISTING = True # always replace existing jobs
APSCHEDULER_COALESCE = os.getenv("APSCHEDULER_COALESCE", "True").lower() in ["true", "1"] # collapse many missed runs into one
APSCHEDULER_MISFIRE_GRACE_TIME = int(os.getenv("APSCHEDULER_MISFIRE_GRACE_TIME", 3600)) # ignore runs older than 1 hour (was 120)
APSCHEDULER_MAX_INSTANCES = int(os.getenv("APSCHEDULER_MAX_INSTANCES", 1)) # prevent concurrent job instances
APSCHEDULER_REPLACE_EXISTING = os.getenv("APSCHEDULER_REPLACE_EXISTING", "True").lower() in ["true", "1"] # always replace existing jobs
DEFAULT_HEALTH_CHECK_INTERVAL = int(
os.getenv("DEFAULT_HEALTH_CHECK_INTERVAL", 300)

View File

@@ -26,10 +26,11 @@ def test_all_numeric_constants_can_be_overridden():
constants_attributes = inspect.getmembers(constants)
# Filter for uppercase constants (by convention) that are integers or floats
# Exclude booleans since bool is a subclass of int in Python
numeric_constants = [
(name, value)
for name, value in constants_attributes
if name.isupper() and isinstance(value, (int, float))
if name.isupper() and isinstance(value, (int, float)) and not isinstance(value, bool)
]
# Ensure we found some constants to test