Skip to content

The agent that grows with you

fix: guard against string schedule in _clear_run_claim_best_effort

kshitij3baf6c14a5da
diff --git a/cron/scheduler.py b/cron/scheduler.py
index efc96e67eaa..c625ba6f7b3 100644
--- a/cron/scheduler.py
+++ b/cron/scheduler.py
@@ -6869,7 +6869,8 @@ def tick(
— a stale claim expiring at the TTL is a better outcome than
crashing the tick (#86522).
"""
- if (job.get("schedule") or {}).get("kind") != "once":
+ _schedule = job.get("schedule")
+ if not (isinstance(_schedule, dict) and _schedule.get("kind") == "once"):
return
try:
clear_run_claim(job_id)