瀏覽代碼

Join threads at shutdown. Related to issue #152

Ask Solem 14 年之前
父節點
當前提交
db2b6643f4
共有 2 個文件被更改,包括 2 次插入0 次删除
  1. 1 0
      celery/worker/controllers.py
  2. 1 0
      celery/worker/heartbeat.py

+ 1 - 0
celery/worker/controllers.py

@@ -60,6 +60,7 @@ class BackgroundThread(threading.Thread):
         self.on_stop()
         self._shutdown.set()
         self._stopped.wait() # block until this thread is done
+        self.join(1e100)
 
 
 class Mediator(BackgroundThread):

+ 1 - 0
celery/worker/heartbeat.py

@@ -58,3 +58,4 @@ class Heart(threading.Thread):
         self._state = "CLOSE"
         self._shutdown.set()
         self._stopped.wait() # block until this thread is done
+        self.join(1e100)