Browse Source

prefetch_count can't be less than 1 if prefetch count set, and should not be decremented if prefetch count is disabled (0).

Ask Solem 15 năm trước cách đây
mục cha
commit
3ce22c471c
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      celery/worker/listener.py

+ 2 - 2
celery/worker/listener.py

@@ -117,12 +117,12 @@ class QoS(object):
 
     def increment(self):
         """Increment the current prefetch count value by one."""
-        if int(self.value):
+        if int(self.value) > 0:
             return self.set(self.value.increment())
 
     def decrement(self):
         """Decrement the current prefetch count value by one."""
-        if int(self.value):
+        if int(self.value) > 1:
             return self.set(self.value.decrement())
 
     def decrement_eventually(self):