Skip to content

Commit

Permalink
handle closed/full queues in eventlog
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinz01 committed Jun 15, 2024
1 parent 11c9c09 commit c625eb7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion redpepper/manager/eventlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ def add_consumer(self):
send, recv = trio.open_memory_channel(10)
self.consumers[id(recv)] = send
for event in self.most_recent:
send.send_nowait(event)
try:
send.send_nowait(event)
except (trio.WouldBlock, trio.ClosedResourceError) as e:
logger.warn("Event bus consumer queue full or closed: %s", e)
return recv

def remove_consumer(self, consumer):
Expand Down

0 comments on commit c625eb7

Please sign in to comment.