Fix: COMPACT_QUEUE should be a unique key.

This fixes #230.  Thanks, @sylvinus.
This commit is contained in:
Vincent Driessen 2013-09-02 22:51:26 +02:00
parent 60dba7c106
commit 1b558704d3
1 changed files with 3 additions and 1 deletions

View File

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