trytond-patches/issue11937.diff

16 lines
585 B
Diff
Raw Normal View History

2023-01-04 16:07:34 +01:00
--- a/tryton/trytond/trytond/worker.py
+++ b/tryton/trytond/trytond/worker.py
@@ -73,7 +73,10 @@ def work(options):
2022-12-07 17:07:30 +01:00
while len(tasks.filter()) >= processes:
time.sleep(0.1)
for queue in queues:
- task_id, next_ = queue.pull(options.name)
+ try:
+ task_id, next_ = queue.pull(options.name)
+ except backend.DatabaseOperationalError:
+ break
if next_ is not None:
timeout = min(next_, timeout)
2022-12-07 17:07:30 +01:00
if task_id: