requeueing preserves job timeout

This commit is contained in:
Goran Peretin 2012-07-17 08:41:24 +02:00
parent 317a58a3b5
commit 34d161eb11
2 changed files with 13 additions and 1 deletions

View File

@ -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)

View File

@ -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)