Skip to content

Commit

Permalink
hive-messaging: Avoid "close called on closed connection" errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gbenson committed Sep 25, 2024
1 parent c1dba13 commit 8db2d9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/messaging/hive/messaging/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def __enter__(self):
return self

def __exit__(self, *exc_info):
self._pika.close()
if self._pika.is_open:
self._pika.close()

def channel(self, *args, **kwargs):
"""Like :class:pika.channel.Channel` but with different defaults.
Expand Down

0 comments on commit 8db2d9f

Please sign in to comment.