瀏覽代碼

Better handling of badly formated messages.

Leo Dirac 13 年之前
父節點
當前提交
94d067555d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      celery/worker/consumer.py

+ 1 - 1
celery/worker/consumer.py

@@ -391,7 +391,7 @@ class Consumer(object):
                     "Couldn't ack %r: body:%r reason:%r" % (
                         message.delivery_tag, safe_repr(body), exc))
 
-        if not body.get("task"):
+        if not isinstance(body,dict) or not body.get("task"):
             warnings.warn(RuntimeWarning(
                 "Received and deleted unknown message. Wrong destination?!? \
                 the full contents of the message body was: %s" % (