Skip to content

Commit c99d000

Browse files
sebalixthienvh332
authored andcommitted
queue_job: triggers stored computed fields before calling 'set_done()'
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.
1 parent d6e0a61 commit c99d000

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

queue_job/controllers/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ def _try_perform_job(self, env, job):
3434
_logger.debug("%s started", job)
3535

3636
job.perform()
37+
# Triggers any stored computed fields before calling 'set_done'
38+
# so that will be part of the 'exec_time'
39+
env["base"].flush()
3740
job.set_done()
3841
job.store()
3942
env.flush_all()

0 commit comments

Comments
 (0)