mirror of https://github.com/zulip/zulip.git
queue: Only NAK the events if the channel is still open.
If the exception was because the channel closed, attempting to NAK the events will just raise another error, and is pointless, as the server already marked the pending events as NAK'd.
This commit is contained in:
parent
55b26da82b
commit
2b37a35f71
|
@ -217,7 +217,8 @@ class SimpleQueueClient(QueueClient[BlockingChannel]):
|
||||||
callback(events)
|
callback(events)
|
||||||
channel.basic_ack(max_processed, multiple=True)
|
channel.basic_ack(max_processed, multiple=True)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
channel.basic_nack(max_processed, multiple=True)
|
if channel.is_open:
|
||||||
|
channel.basic_nack(max_processed, multiple=True)
|
||||||
raise
|
raise
|
||||||
events = []
|
events = []
|
||||||
last_process = now
|
last_process = now
|
||||||
|
|
Loading…
Reference in New Issue