Skip to content

Commit

Permalink
queue_job: triggers stored computed fields before calling 'set_done()'
Browse files Browse the repository at this point in the history
So the time required to compute such fields by the ORM is taken into
account when the 'date_done' and 'exec_time' values are set on the job.
  • Loading branch information
sebalix authored and thienvh332 committed Oct 7, 2024
1 parent d6e0a61 commit c99d000
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions queue_job/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def _try_perform_job(self, env, job):
_logger.debug("%s started", job)

job.perform()
# Triggers any stored computed fields before calling 'set_done'
# so that will be part of the 'exec_time'
env["base"].flush()
job.set_done()
job.store()
env.flush_all()
Expand Down

0 comments on commit c99d000

Please sign in to comment.