Browse Source

timer2.Timer: Add timeout when waiting for not_empty

Ask Solem 14 năm trước cách đây
mục cha
commit
dbc104e60e
1 tập tin đã thay đổi với 1 bổ sung2 xóa
  1. 1 2
      celery/utils/timer2.py

+ 1 - 2
celery/utils/timer2.py

@@ -158,8 +158,7 @@ class Timer(Thread):
         try:
             delay = self.scheduler.next()
             if delay is None:
-                print("WAITING FOR ENTRY")
-                self.not_empty.wait()
+                self.not_empty.wait(1.0)
             return delay
         finally:
             self.not_empty.release()