瀏覽代碼

AMQP result backend: Call on_interval every second (always) to propagate parent errors

Ask Solem 10 年之前
父節點
當前提交
4ae2f1d631
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      celery/backends/amqp.py

+ 4 - 1
celery/backends/amqp.py

@@ -213,7 +213,10 @@ class AMQPBackend(BaseBackend):
             # Total time spent may exceed a single call to wait()
             if timeout and now() - time_start >= timeout:
                 raise socket.timeout()
-            wait(timeout=timeout)
+            try:
+                wait(timeout=1)
+            except socket.timeout:
+                pass
             if on_interval:
                 on_interval()
             if results:  # got event on the wanted channel.