Procházet zdrojové kódy

Fix for a race condition where Timer.enter is called twice before the thread actually runs.

Noah Kantrowitz před 14 roky
rodič
revize
b34074a584
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      celery/utils/timer2.py

+ 1 - 1
celery/utils/timer2.py

@@ -180,7 +180,7 @@ class Timer(Thread):
             self.running = False
 
     def enter(self, entry, eta, priority=None):
-        if not self.running:
+        if not self.running and not self.is_alive():
             self.start()
         return self.schedule.enter(entry, eta, priority)