mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 12:17:13 +00:00
fix(deploy): read INFINITO_MAX_RUNTIME without an empty-string default
The empty-string fallback in os.environ.get(KEY, '') is forbidden for INFINITO_* vars (test_no_infinito_get_defaults) — defaults live in default.env/handler. Read it with no default and let _parse_duration_seconds accept None. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
6734bcc4ee
commit
9ceeabb4d6
1 file changed
+4
-2
@@ -10,7 +10,9 @@ from utils.annotations.message import warning
|
||||
_BUFFER_SECONDS = 30 * 60
|
||||
|
||||
|
||||
def _parse_duration_seconds(raw: str) -> int | None:
|
||||
def _parse_duration_seconds(raw: str | None) -> int | None:
|
||||
if not raw:
|
||||
return None
|
||||
raw = raw.strip().lower()
|
||||
if not raw:
|
||||
return None
|
||||
@@ -33,7 +35,7 @@ class RuntimeBudget:
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.max_seconds = _parse_duration_seconds(
|
||||
os.environ.get("INFINITO_MAX_RUNTIME", "")
|
||||
os.environ.get("INFINITO_MAX_RUNTIME")
|
||||
)
|
||||
self._start = time.monotonic()
|
||||
self._longest_round = 0.0
|
||||
|
||||
Reference in new issue
Block a user