mirror of https://github.com/rq/rq.git
requeueing preserves job timeout
This commit is contained in:
parent
317a58a3b5
commit
34d161eb11
|
@ -280,4 +280,4 @@ class FailedQueue(Queue):
|
||||||
|
|
||||||
job.exc_info = None
|
job.exc_info = None
|
||||||
q = Queue(job.origin, connection=self.connection)
|
q = Queue(job.origin, connection=self.connection)
|
||||||
q.enqueue_job(job)
|
q.enqueue_job(job, timeout=job.timeout)
|
||||||
|
|
|
@ -227,3 +227,15 @@ class TestFailedQueue(RQTestCase):
|
||||||
get_failed_queue().quarantine(job, Exception('Some fake error'))
|
get_failed_queue().quarantine(job, Exception('Some fake error'))
|
||||||
|
|
||||||
self.assertEquals(job.timeout, 200)
|
self.assertEquals(job.timeout, 200)
|
||||||
|
|
||||||
|
def test_requeueing_preserves_timeout(self):
|
||||||
|
"""Requeueing preserves job timeout."""
|
||||||
|
job = Job.create(div_by_zero, 1, 2, 3)
|
||||||
|
job.origin = 'fake'
|
||||||
|
job.timeout = 200
|
||||||
|
job.save()
|
||||||
|
get_failed_queue().quarantine(job, Exception('Some fake error'))
|
||||||
|
get_failed_queue().requeue(job.id)
|
||||||
|
|
||||||
|
job = Job.fetch(job.id)
|
||||||
|
self.assertEquals(job.timeout, 200)
|
||||||
|
|
Loading…
Reference in New Issue