Skip to content

Commit

Permalink
Add check for connection closure in shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Jan 14, 2025
1 parent f6045fc commit 3ebd805
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions neon_mq_connector/utils/client_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def __init__(self, config: dict, service_name: str, vhost: str):
def shutdown(self):
MQConnector.stop(self)
self.connection.close()
if not self.connection.is_closed:
raise RuntimeError(f"Connection is still open: {self.connection}")


def send_mq_request(vhost: str, request_data: dict, target_queue: str,
Expand Down

0 comments on commit 3ebd805

Please sign in to comment.