|
|
@ -654,9 +654,10 @@ class TestFailedQueue(RQTestCase):
|
|
|
|
def test_job_in_failed_queue_persists(self):
|
|
|
|
def test_job_in_failed_queue_persists(self):
|
|
|
|
"""Make sure failed job key does not expire"""
|
|
|
|
"""Make sure failed job key does not expire"""
|
|
|
|
q = Queue('foo')
|
|
|
|
q = Queue('foo')
|
|
|
|
job = q.enqueue(div_by_zero, args=(1, 2, 3), ttl=5)
|
|
|
|
job = q.enqueue(div_by_zero, args=(1,), ttl=5)
|
|
|
|
self.assertEqual(self.testconn.ttl(job.key), 5)
|
|
|
|
self.assertEqual(self.testconn.ttl(job.key), 5)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.assertRaises(ZeroDivisionError, job.perform)
|
|
|
|
job.set_status(JobStatus.FAILED)
|
|
|
|
job.set_status(JobStatus.FAILED)
|
|
|
|
failed_queue = get_failed_queue()
|
|
|
|
failed_queue = get_failed_queue()
|
|
|
|
failed_queue.quarantine(job, Exception('Some fake error'))
|
|
|
|
failed_queue.quarantine(job, Exception('Some fake error'))
|
|
|
|