fix: harden _is_recoverable_error_job against schedule=None
job.get("schedule", {}).get("kind") crashes with AttributeError when
schedule is present but explicitly None (disk corruption edge case).
Use (job.get("schedule") or {}).get("kind") instead, which safely
returns False for None. This pattern is already used at other sites
in the file (e.g. cron/scheduler.py line 170).
This commit is contained in:
+1
-1
@@ -667,7 +667,7 @@ def _is_recoverable_error_job(job: Dict[str, Any]) -> bool:
|
||||
"""
|
||||
return (
|
||||
job.get("state") == "error"
|
||||
and job.get("schedule", {}).get("kind") in {"cron", "interval"}
|
||||
and (job.get("schedule") or {}).get("kind") in {"cron", "interval"}
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user