Limit the worker retry delay to maximum 1 hour

Closes #13779
(grafted from b6f5daac0e2b605ca23b360e80066e51eca5bcfb)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2024-12-26 12:47:08 +01:00
parent c002c7ad71
commit 4c381e4b71
+1 -1
View File
@@ -174,7 +174,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: