From fed01844d9e40d0412c332228e9563462afb3f74 Mon Sep 17 00:00:00 2001 From: Brandon Myers Date: Tue, 2 Oct 2018 14:53:33 -0400 Subject: [PATCH] Modify sqs worker to drop non dict messages --- mq/esworker_sqs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mq/esworker_sqs.py b/mq/esworker_sqs.py index 8449d451..620f59a2 100755 --- a/mq/esworker_sqs.py +++ b/mq/esworker_sqs.py @@ -192,6 +192,13 @@ class taskConsumer(object): self.taskQueue.delete_message(msg) continue + # If this is still not a dict, + # let's just drop the message and move on + if type(msgbody) is not dict: + logger.debug("Message is not a dictionary, dropping message.") + self.taskQueue.delete_message(msg) + continue + event = dict() event = msgbody