Преглед на файлове

The Mediator thread should not block for more than 1 second.

Ask Solem преди 15 години
родител
ревизия
00524d6b35
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      celery/worker/buckets.py

+ 1 - 1
celery/worker/buckets.py

@@ -124,7 +124,7 @@ class TaskBucket(object):
             if remaining_time:
                 if not block or did_timeout():
                     raise QueueEmpty
-                time.sleep(remaining_time)
+                time.sleep(min(remaining_time, timeout or 1))
             else:
                 return item