Fix repair worker crash on zero interval_hours division
Jobs with interval_hours set to 0 caused ZeroDivisionError in _pick_next_job staleness calculation. Now skips jobs with invalid (zero or negative) intervals.
This commit is contained in:
parent
c63766145e
commit
2249aa7594
1 changed files with 3 additions and 0 deletions
|
|
@ -489,6 +489,9 @@ class RepairWorker:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
interval_hours = config['interval_hours']
|
interval_hours = config['interval_hours']
|
||||||
|
if not interval_hours or interval_hours <= 0:
|
||||||
|
continue # Skip jobs with invalid interval
|
||||||
|
|
||||||
last_run = self._get_last_run(job_id)
|
last_run = self._get_last_run(job_id)
|
||||||
|
|
||||||
if not last_run or not last_run.get('finished_at'):
|
if not last_run or not last_run.get('finished_at'):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue