rabbit: Fixed auto_ack with generator consumer
This commit is contained in:
@@ -91,5 +91,7 @@ def consume_task(channel, queue: str, timeout=None, auto_ack=True, max_count=Non
|
||||
yield body
|
||||
if max_count and method.delivery_tag == max_count:
|
||||
break
|
||||
if not auto_ack:
|
||||
channel.basic_ack(delivery_tag=method.delivery_tag)
|
||||
requeued_messages = channel.cancel()
|
||||
_logger.info(f"Requeued {requeued_messages} messages")
|
||||
|
||||
Reference in New Issue
Block a user