Browse Source

Do not call Pool.flush if terminated

Ask Solem 12 years ago
parent
commit
bf897e01eb
1 changed files with 2 additions and 0 deletions
  1. 2 0
      celery/concurrency/processes.py

+ 2 - 0
celery/concurrency/processes.py

@@ -823,6 +823,8 @@ class TaskPool(BasePool):
             hub.timer.apply_interval(interval * 1000.0, handler)
 
     def flush(self):
+        if self._pool._state == TERMINATE:
+            return
         # cancel all tasks that have not been accepted so that NACK is sent.
         for job in values(self._pool._cache):
             if not job._accepted: