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

Sleep only 0.2s not 1s after empty queue (round-trip time went from 0.03s to 0.01s, without hammering CPU)

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

+ 1 - 1
celery/worker/controllers.py

@@ -88,7 +88,7 @@ class Mediator(BackgroundThread):
             # This blocks until there's a message in the queue.
             task = self.ready_queue.get(timeout=1)
         except QueueEmpty:
-            time.sleep(1)
+            time.sleep(0.2)
         else:
             if task.task_id in revoked: # task revoked
                 task.on_ack()