From 85dbc20a80a2b4c233708be1460da7909e205388 Mon Sep 17 00:00:00 2001 From: Christopher Baklid Date: Fri, 25 May 2018 14:21:10 +0200 Subject: lint --- rmq/consumer.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'rmq/consumer.py') diff --git a/rmq/consumer.py b/rmq/consumer.py index 8e1ce2b..2c41e26 100644 --- a/rmq/consumer.py +++ b/rmq/consumer.py @@ -3,7 +3,14 @@ import traceback import pika from pika.exceptions import ConnectionClosed -def consume(username='guest', password='guest', host='localhost', port=5672, queue='', callback=None): + +def consume(username='guest', + password='guest', + host='localhost', + port=5672, + queue='', + callback=None): + while True: credentials = pika.PlainCredentials(username, password) con_params = pika.ConnectionParameters(host, port, '/', credentials) @@ -21,7 +28,7 @@ def consume(username='guest', password='guest', host='localhost', port=5672, que channel.start_consuming() - except: + except Exception: exc = traceback.format_exc() print(exc, flush=True) -- cgit v1.2.3