From 1b558704d390579b4aab6e571b5e49d8236939fc Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 2 Sep 2013 22:51:26 +0200 Subject: [PATCH] Fix: COMPACT_QUEUE should be a unique key. This fixes #230. Thanks, @sylvinus. --- rq/queue.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rq/queue.py b/rq/queue.py index 2404eead..e5b3b04f 100644 --- a/rq/queue.py +++ b/rq/queue.py @@ -1,4 +1,6 @@ import times +import uuid + from .connections import resolve_connection from .job import Job, Status from .exceptions import (NoSuchJobError, UnpickleError, @@ -114,7 +116,7 @@ class Queue(object): """Removes all "dead" jobs from the queue by cycling through it, while guarantueeing FIFO semantics. """ - COMPACT_QUEUE = 'rq:queue:_compact' + COMPACT_QUEUE = 'rq:queue:_compact:{0}'.format(uuid.uuid4()) self.connection.rename(self.key, COMPACT_QUEUE) while True: