catch redis exceptions
@@ -108,6 +108,7 @@ def callback(ch, method, properties, body):
r = setup_redis()
print('redis: {0}'.format(status))
if r:
+ try:
r.hmset('status', status)
statuses = r.hgetall('status')
for s in statuses:
@@ -117,6 +118,8 @@ def callback(ch, method, properties, body):
status[worker] = extra_workers[worker]
r.hmset('status', status)
r.close()
+ except Exception as e: # pragma: no cover
+ print('Failed to update Redis because: {0}'.format(str(e)))
def main(queue_name, host):
