Limit the worker retry delay to maximum 1 hour

Closes #13779
This commit is contained in:
Cédric Krier committed 2024-12-26 12:47:08 +01:00
1 parent 801a06970b
commit d1ce25bd4f
1 file changed
+1 -1
+1 -1
View File
@@ -189,7 +189,7 @@ def run_task(pool, task_id):
duration = (task.scheduled_at - task.enqueued_at) * 2
else:
duration = dt.timedelta(seconds=2 * retry)
duration = max(duration, dt.timedelta(hours=1))
duration = min(duration, dt.timedelta(hours=1))
scheduled_at = dt.datetime.now() + duration * random.random()
Queue.push(task.name, task.data, scheduled_at=scheduled_at)
except Exception: