Преглед на файлове

Better handling of badly formated messages.

Leo Dirac преди 14 години
родител
ревизия
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" % (