Trigger a refresh after job execution

* Prevents clobbering of user-supplied metadata
  modified during the job execution
main
Benjamin Root 8 years ago
parent b241d50c10
commit 56c89c1334

@ -705,6 +705,7 @@ class Worker(object):
try:
with self.death_penalty_class(job.timeout or self.queue_class.DEFAULT_TIMEOUT):
rv = job.perform()
job.refresh()
job.ended_at = utcnow()
@ -718,6 +719,7 @@ class Worker(object):
started_job_registry=started_job_registry
)
except Exception:
job.refresh()
self.handle_job_failure(
job=job,
started_job_registry=started_job_registry

Loading…
Cancel
Save