summaryrefslogtreecommitdiff
path: root/kombu/transport/SQS.py
diff options
context:
space:
mode:
authorAsk Solem <ask@celeryproject.org>2014-01-28 16:23:50 +0000
committerAsk Solem <ask@celeryproject.org>2014-01-28 16:23:50 +0000
commit66aee530954f8ad9e3e0424bb99daf111bfca0fd (patch)
treedc7b43aed60dff8f3a05ba06a8d23b85d1cc795b /kombu/transport/SQS.py
parent8dfc24453c6accad56de14abdf518937c2d6aa65 (diff)
downloadkombu-66aee530954f8ad9e3e0424bb99daf111bfca0fd.tar.gz
Forgot to commit file (celery/celery#1818)
Diffstat (limited to 'kombu/transport/SQS.py')
-rw-r--r--kombu/transport/SQS.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/kombu/transport/SQS.py b/kombu/transport/SQS.py
index 008b032f..1c50505e 100644
--- a/kombu/transport/SQS.py
+++ b/kombu/transport/SQS.py
@@ -395,12 +395,13 @@ class Channel(virtual.Channel):
# one message.
maxcount = self.qos.can_consume_max_estimate()
maxcount = max_if_unlimited if maxcount is None else max(maxcount, 1)
- messages = self._get_from_sqs(
- queue, count=min(maxcount, SQS_MAX_MESSAGES),
- )
+ if maxcount:
+ messages = self._get_from_sqs(
+ queue, count=min(maxcount, SQS_MAX_MESSAGES),
+ )
- if messages:
- return self._messages_to_python(messages, queue)
+ if messages:
+ return self._messages_to_python(messages, queue)
raise Empty()
def _get(self, queue):