File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -90,10 +90,13 @@ def mark_lost_jobs(self):
90
90
# In theory we could save a timeout per-job and mark them timed-out more quickly,
91
91
# but if they're still running, we can't actually send a signal to cancel it...
92
92
now = timezone .now ()
93
- one_day_ago = now - datetime .timedelta (seconds = settings .JOBS_LOST_AFTER )
93
+ cutoff = now - datetime .timedelta (seconds = settings .JOBS_LOST_AFTER )
94
94
lost_jobs = self .filter (
95
- created_at__lt = one_day_ago
95
+ created_at__lt = cutoff
96
96
) # Doesn't matter whether it started or not -- it shouldn't take this long.
97
+
98
+ # Note that this will save it in the results,
99
+ # but lost jobs are only retried if they have a retry!
97
100
for job in lost_jobs :
98
101
job .convert_to_result (
99
102
ended_at = now ,
You can’t perform that action at this time.
0 commit comments