From d619dc7ef273ae62987c05eb3818d41707eeea30 Mon Sep 17 00:00:00 2001 From: shawnsarwar Date: Tue, 3 Nov 2020 17:30:11 +0100 Subject: [PATCH] chore: log failures of redis sending (#913) --- aether-kernel/aether/kernel/api/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aether-kernel/aether/kernel/api/utils.py b/aether-kernel/aether/kernel/api/utils.py index 9e5d7da43..d4f5b04b3 100644 --- a/aether-kernel/aether/kernel/api/utils.py +++ b/aether-kernel/aether/kernel/api/utils.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. +import logging import time from django.conf import settings @@ -28,6 +29,8 @@ from . import models, redis REDIS_TASK = TaskHelper(settings) +logger = logging.getLogger(__name__) +logger.setLevel(settings.LOGGING_LEVEL) def safe_sleep(): @@ -207,5 +210,5 @@ def send_model_item_to_redis(model_item): else: REDIS_TASK.add(obj, model_name, realm) - except Exception: # pragma: no cover : happens only when redis is offline - pass + except Exception as err: # pragma: no cover : happens only when redis is offline + logger.debug(f'Failed to submit to Redis: {err}')