diff options
author | Ask Solem <ask@celeryproject.org> | 2014-01-28 16:22:57 +0000 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2014-01-28 16:22:57 +0000 |
commit | 8dfc24453c6accad56de14abdf518937c2d6aa65 (patch) | |
tree | 852bb56304c7c20e05246925efef63995aea6122 | |
parent | 24e7e347822826a2b9d4bb1e503a49efeb4e3af6 (diff) | |
download | kombu-8dfc24453c6accad56de14abdf518937c2d6aa65.tar.gz |
SQS: batch mode always consumes messages. Closes celery/celery#1818
-rw-r--r-- | kombu/transport/virtual/__init__.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/kombu/transport/virtual/__init__.py b/kombu/transport/virtual/__init__.py index 459d55b1..c05e65d1 100644 --- a/kombu/transport/virtual/__init__.py +++ b/kombu/transport/virtual/__init__.py @@ -142,14 +142,8 @@ class QoS(object): An integer > 0 """ pcount = self.prefetch_count - count = None if pcount: - count = pcount - (len(self._delivered) - len(self._dirty)) - - if count < 1: - return 1 - - return count + return max(pcount - (len(self._delivered) - len(self._dirty), 0) def append(self, message, delivery_tag): """Append message to transactional state.""" |