changeset 5fe8afce571d in trytond:6.0
details: https://hg.tryton.org/trytond?cmd=changeset&node=5fe8afce571d
description:
Do not retry failing cron task directly
The next call datetime is set even if the task is failing. This way it
will be
retried based on the configured frequency.
issue10695
review358751002
(grafted from befd1119ab8d12bf79e2b439376940f251b03280)
diffstat:
trytond/ir/cron.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (22 lines):
diff -r 947d458462af -r 5fe8afce571d trytond/ir/cron.py
--- a/trytond/ir/cron.py Thu Sep 02 23:19:36 2021 +0200
+++ b/trytond/ir/cron.py Fri Sep 10 19:08:38 2021 +0200
@@ -162,8 +162,6 @@
try:
with processing(name):
cron.run_once()
- cron.next_call = cron.compute_next_call(now)
- cron.save()
transaction.commit()
except Exception as e:
transaction.rollback()
@@ -171,6 +169,9 @@
and count):
continue
logger.error('%s failed', name, exc_info=True)
+ cron.next_call = cron.compute_next_call(now)
+ cron.save()
+ transaction.commit()
break
while transaction.tasks:
task_id = transaction.tasks.pop()