Explorar o código

Do not call Pool.flush if terminated

Ask Solem %!s(int64=12) %!d(string=hai) anos
pai
achega
bf897e01eb
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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: