Browse Source

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

Noah Kantrowitz 14 years ago
parent
commit
b34074a584
1 changed files with 1 additions and 1 deletions
  1. 1 1
      celery/utils/timer2.py

+ 1 - 1
celery/utils/timer2.py

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