codex.bot
codex.bot copied to clipboard
pika does not support connection recovery
Provide smth like this https://github.com/pika/pika/issues/858
while True:
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
channel.basic_consume(on_message, 'queue')
try:
channel.start_consuming()
except pika.exceptions.ConnectionClosed:
LOGGER.info('Connection closed. Recovering')
continue
except KeyboardInterrupt:
channel.stop_consuming()
connection.close()
break```
Append this code and create issue for SDK