Merge pull request #637 from olingerc/remove_current_job

worker left with current_job set after job exception
main
Selwin Ong 9 years ago
commit 00645434ac

@ -594,6 +594,7 @@ class Worker(object):
except Exception:
job.set_status(JobStatus.FAILED, pipeline=pipeline)
started_job_registry.remove(job, pipeline=pipeline)
self.set_current_job_id(None, pipeline=pipeline)
try:
pipeline.execute()
except Exception:

@ -157,6 +157,7 @@ class TestWorker(RQTestCase):
# Postconditions
self.assertEqual(q.count, 0)
self.assertEqual(failed_q.count, 1)
self.assertEquals(w.get_current_job_id(), None)
# Check the job
job = Job.fetch(job.id)

Loading…
Cancel
Save