Add worker_logger.diff | #048235

This commit is contained in:
Jared Esparza 2021-12-15 17:47:57 +01:00
parent 69b0eb067b
commit a38119c4ae
2 changed files with 23 additions and 1 deletions

4
series
View File

@ -27,4 +27,6 @@ issue10464.diff # [currency] Update currency rates fails
sao_colors.diff # [sao] Use the same colors as 5.4 version
sao_remove_email.diff # [sao] Removes the email button from the toolbar
sao_remove_email.diff # [sao] Removes the email button from the toolbar
worker_logger.diff #[trytond] Move exception handling into transaction to keep the database name

20
worker_logger.diff Normal file
View File

@ -0,0 +1,20 @@
diff --git a/trytond/worker.py b/trytond/worker.py
index 4088e2b6..46393e92 100644
--- a/trytond/worker.py
+++ b/trytond/worker.py
@@ -126,6 +126,9 @@ def run_task(pool, task_id):
except (UserError, UserWarning) as e:
Error.log(task, e)
raise
+ except Exception:
+ logger.critical('%s failed', name, exc_info=True)
+ return
logger.info('%s done', name)
except backend.DatabaseOperationalError:
logger.info('%s failed, retrying', name, exc_info=True)
@@ -146,5 +149,3 @@ def run_task(pool, task_id):
'rescheduling %s failed', name, exc_info=True)
except (UserError, UserWarning):
logger.info('%s failed', name)
- except Exception:
- logger.critical('%s failed', name, exc_info=True)