changeset befd1119ab8d in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=befd1119ab8d
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
diffstat:

 trytond/ir/cron.py |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r b092e76193d8 -r befd1119ab8d trytond/ir/cron.py
--- a/trytond/ir/cron.py        Sun Sep 05 14:40:15 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()

Reply via email to