Skip to content

Commit

Permalink
Merge b504045 into 1e77b25
Browse files Browse the repository at this point in the history
  • Loading branch information
2zx authored May 24, 2018
2 parents 1e77b25 + b504045 commit d2718c3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions queue_job/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@ def runjob(self, db, job_uuid, **kw):
env = http.request.env(user=odoo.SUPERUSER_ID)

def retry_postpone(job, message, seconds=None):
job.postpone(result=message, seconds=seconds)
job.set_pending(reset_retry=False)
job.store()
env.cr.commit()

job.env.cr.rollback()
job.env.clear()
with odoo.api.Environment.manage():
with odoo.registry(job.env.cr.dbname).cursor() as new_cr:
job.env = job.env(cr=new_cr)
job.postpone(result=message, seconds=seconds)
job.set_pending(reset_retry=False)
job.store()
new_cr.commit()

job = self._load_job(env, job_uuid)
if job is None:
Expand Down

0 comments on commit d2718c3

Please sign in to comment.