Pārlūkot izejas kodu

Better handling of badly formated messages.

Leo Dirac 13 gadi atpakaļ
vecāks
revīzija
94d067555d
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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" % (