mirror of https://github.com/celery/kombu.git
virtual: Prefetch count was totally broken, because of a logic error
This commit is contained in:
parent
743fe9abb2
commit
4cfe6798cb
|
@ -79,7 +79,7 @@ class QoS(object):
|
|||
|
||||
"""
|
||||
pcount = self.prefetch_count
|
||||
return (not pcount or len(self._delivered) > pcount)
|
||||
return (not pcount or len(self._delivered) < pcount)
|
||||
|
||||
def append(self, message, delivery_tag):
|
||||
"""Append message to transactional state."""
|
||||
|
@ -236,6 +236,7 @@ class Channel(AbstractChannel):
|
|||
self._consumers = set()
|
||||
self._tag_to_queue = {}
|
||||
self._qos = None
|
||||
self.closed = False
|
||||
|
||||
# instantiate exchange types
|
||||
self.exchange_types = dict((typ, cls(self))
|
||||
|
@ -429,6 +430,7 @@ class Channel(AbstractChannel):
|
|||
def close(self):
|
||||
"""Close channel, cancel all consumers, and requeue unacked
|
||||
messages."""
|
||||
self.closed = True
|
||||
map(self.basic_cancel, list(self._consumers))
|
||||
self.qos.restore_unacked_once()
|
||||
self.connection.close_channel(self)
|
||||
|
|
Loading…
Reference in New Issue