|
@@ -1,12 +1,11 @@
|
|
|
import time
|
|
|
|
|
|
from collections import deque
|
|
|
-from itertools import chain
|
|
|
from Queue import Queue, Empty as QueueEmpty
|
|
|
|
|
|
from celery.utils import all
|
|
|
from celery.utils import timeutils
|
|
|
-from celery.utils.compat import izip_longest
|
|
|
+from celery.utils.compat import izip_longest, chain_from_iterable
|
|
|
|
|
|
|
|
|
class RateLimitExceeded(Exception):
|
|
@@ -180,7 +179,7 @@ class TaskBucket(object):
|
|
|
def items(self):
|
|
|
# for queues with contents [(1, 2), (3, 4), (5, 6), (7, 8)]
|
|
|
# zips and flattens to [1, 3, 5, 7, 2, 4, 6, 8]
|
|
|
- return filter(None, chain.from_iterable(izip_longest(*[bucket.items
|
|
|
+ return filter(None, chain_from_iterable(izip_longest(*[bucket.items
|
|
|
for bucket in self.buckets.values()])))
|
|
|
|
|
|
|