level 5: track 1
Skeleton contracts / contracts (pull_request) Failing after 28s

This commit is contained in:
2026-10-29 10:53:32 +03:00
parent 175a8d8bfd
commit 6e84c7a7fc
10 changed files with 736 additions and 25 deletions
+9
View File
@@ -13,6 +13,7 @@ class Settings:
session_ttl_seconds: int
database_url: str
redis_url: str
history_cache: str
def _secret(file_var: str, value_var: str) -> str:
@@ -32,6 +33,13 @@ def _secret(file_var: str, value_var: str) -> str:
return value
def _history_cache() -> str:
mode = os.getenv('HISTORY_CACHE', 'protected').strip().lower() or 'protected'
if mode not in ('protected', 'naive', 'off'):
raise RuntimeError('HISTORY_CACHE must be protected, naive or off')
return mode
def load_settings() -> Settings:
return Settings(
host=os.getenv('APP_HOST', '0.0.0.0'),
@@ -42,4 +50,5 @@ def load_settings() -> Settings:
session_ttl_seconds=int(os.getenv('SESSION_TTL_SECONDS', '3600')),
database_url=_secret('DATABASE_URL_FILE', 'DATABASE_URL'),
redis_url=_secret('CACHE_URL_FILE', 'REDIS_URL'),
history_cache=_history_cache(),
)