mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Merge pull request #6670 from ryanpetrello/redis-fixup
work around redis connection failures in the callback receiver Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -118,9 +118,14 @@ class AWXConsumerRedis(AWXConsumerBase):
|
|||||||
|
|
||||||
queue = redis.Redis.from_url(settings.BROKER_URL)
|
queue = redis.Redis.from_url(settings.BROKER_URL)
|
||||||
while True:
|
while True:
|
||||||
res = queue.blpop(self.queues)
|
try:
|
||||||
res = json.loads(res[1])
|
res = queue.blpop(self.queues)
|
||||||
self.process_task(res)
|
res = json.loads(res[1])
|
||||||
|
self.process_task(res)
|
||||||
|
except redis.exceptions.RedisError:
|
||||||
|
logger.exception(f"encountered an error communicating with redis")
|
||||||
|
except (json.JSONDecodeError, KeyError):
|
||||||
|
logger.exception(f"failed to decode JSON message from redis")
|
||||||
if self.should_stop:
|
if self.should_stop:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user