Skip to content

Commit

Permalink
Cleanup logging
Browse files Browse the repository at this point in the history
Troubleshoot blocking connection usage
  • Loading branch information
NeonDaniel committed Jan 21, 2025
1 parent a4d9083 commit 643e386
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions neon_mq_connector/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,6 @@ def emit_mq_message(cls,
cls.create_unique_id())

def _on_channel_open(new_channel):
while not new_channel.is_open:
LOG.warning(f"Waiting for channel to open ({new_channel})")
if exchange:
new_channel.exchange_declare(exchange=exchange,
exchange_type=exchange_type,
Expand All @@ -321,10 +319,10 @@ def _on_channel_open(new_channel):
new_channel.close()

if isinstance(connection, pika.BlockingConnection):
LOG.info(f"Using blocking connection for queue: {queue}")
LOG.info(f"Using blocking connection for request: {request_data}")
_on_channel_open(connection.channel())
else:
LOG.info(f"Using select connection for queue: {queue}")
LOG.debug(f"Using select connection for queue: {queue}")
connection.channel(on_open_callback=_on_channel_open)

LOG.debug(f"sent message: {request_data['message_id']}")
Expand Down

0 comments on commit 643e386

Please sign in to comment.