Skip to content

The agent that grows with you

refactor(cron): name forget_stores for what it takes; fix the clear_run_claim early-return comment

kshitijk4poore9a193320454
diff --git a/cron/jobs.py b/cron/jobs.py
index 9547c369c6a..6a0ca9cb1c3 100644
--- a/cron/jobs.py
+++ b/cron/jobs.py
@@ -2679,7 +2679,7 @@ def clear_run_claim(job_id: str) -> bool:
def apply(jobs, _i, job):
claim = job.get("run_claim")
if job.get("schedule", {}).get("kind") != "once" or claim in (None, {"outage": True}):
- return False # recurring, or already cleared
+ return False # recurring, already cleared, or already reduced to the outage marker
# Keep the outage marker (no "at": a stale claim, so it re-dispatches) or the skipped
# one-shot, past its grace, is retired as missed on the next scan.
job["run_claim"] = {"outage": True} if isinstance(claim, dict) and claim.get("outage") else None
diff --git a/cron/store_health.py b/cron/store_health.py
index cfc0efdd2ec..1d2c215860d 100644
--- a/cron/store_health.py
+++ b/cron/store_health.py
@@ -167,7 +167,7 @@ def store_key(home) -> str:
return _key(Path(home) / "cron")
-def forget_homes(stores) -> None:
+def forget_stores(stores) -> None:
"""Drop the state of ``stores`` (``store_key`` values, resolved while each home existed) whose
profile this process no longer ticks, so a profile that left this gateway cannot keep the
host-wide gauges at writable=0."""