diff --git a/rq/queue.py b/rq/queue.py index ac5bd52..a7e5dfe 100644 --- a/rq/queue.py +++ b/rq/queue.py @@ -280,4 +280,4 @@ class FailedQueue(Queue): job.exc_info = None q = Queue(job.origin, connection=self.connection) - q.enqueue_job(job) + q.enqueue_job(job, timeout=job.timeout) diff --git a/tests/test_queue.py b/tests/test_queue.py index 93a0c9b..9f2c4da 100644 --- a/tests/test_queue.py +++ b/tests/test_queue.py @@ -227,3 +227,15 @@ class TestFailedQueue(RQTestCase): get_failed_queue().quarantine(job, Exception('Some fake error')) 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)