From 4c381e4b71ac0870fdff15eab2b0220bbe34bacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 26 Dec 2024 12:47:08 +0100 Subject: [PATCH] Limit the worker retry delay to maximum 1 hour Closes #13779 (grafted from b6f5daac0e2b605ca23b360e80066e51eca5bcfb) --HG-- branch : 7.0 --- trytond/trytond/worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/trytond/worker.py b/trytond/trytond/worker.py index 8bcdfe0003..0ee7c65dac 100644 --- a/trytond/trytond/worker.py +++ b/trytond/trytond/worker.py @@ -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: