From 8dfc24453c6accad56de14abdf518937c2d6aa65 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Tue, 28 Jan 2014 16:22:57 +0000 Subject: [PATCH] SQS: batch mode always consumes messages. Closes celery/celery#1818 --- kombu/transport/virtual/__init__.py | 8 +------- 1 file changed, 1 insertion(+), 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."""