mirror of
https://github.com/ansible/awx.git
synced 2026-07-02 11:58:03 -02:30
Sensible log behavior when redis is unavailable (#15466)
* Sensible log behavior when redis is unavailable * Consistent behavior with dispatcher and callback
This commit is contained in:
@@ -10,6 +10,8 @@ import time
|
||||
import sys
|
||||
import signal
|
||||
|
||||
import redis
|
||||
|
||||
# Django
|
||||
from django.db import transaction
|
||||
from django.utils.translation import gettext_lazy as _, gettext_noop
|
||||
@@ -120,6 +122,8 @@ class TaskBase:
|
||||
self.subsystem_metrics.pipe_execute()
|
||||
else:
|
||||
logger.debug(f"skipping recording {self.prefix} metrics, last recorded {time_last_recorded} seconds ago")
|
||||
except redis.exceptions.ConnectionError as exc:
|
||||
logger.warning(f"Redis connection error saving metrics for {self.prefix}, error: {exc}")
|
||||
except Exception:
|
||||
logger.exception(f"Error saving metrics for {self.prefix}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user