mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
Add worker_logger.diff | #048235
This commit is contained in:
parent
69b0eb067b
commit
a38119c4ae
2
series
2
series
|
@ -28,3 +28,5 @@ issue10464.diff # [currency] Update currency rates fails
|
||||||
sao_colors.diff # [sao] Use the same colors as 5.4 version
|
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
20
worker_logger.diff
Normal 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)
|
Loading…
Reference in a new issue