mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] forwardport: queue reliability changes
Previous version would break if _process_item itself committed which was bad
This commit is contained in:
parent
3ce3dd9569
commit
bad016b830
@ -2,8 +2,6 @@
|
||||
import logging
|
||||
from contextlib import ExitStack
|
||||
|
||||
import subprocess
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
@ -16,12 +14,13 @@ class Queue:
|
||||
def _process(self):
|
||||
for b in self.search([]):
|
||||
try:
|
||||
with self.env.cr.savepoint():
|
||||
b._process_item()
|
||||
b._process_item()
|
||||
b.unlink()
|
||||
self.env.cr.commit()
|
||||
except Exception:
|
||||
_logger.exception("Error while processing %s, skipping", b)
|
||||
self.env.cr.rollback()
|
||||
self.clear_caches()
|
||||
|
||||
class BatchQueue(models.Model, Queue):
|
||||
_name = 'forwardport.batches'
|
||||
|
Loading…
Reference in New Issue
Block a user