Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #914 from eHealthAfrica/develop
Browse files Browse the repository at this point in the history
chore: log failures of redis sending (#913)
  • Loading branch information
shawnsarwar authored Nov 3, 2020
2 parents 5426d8b + d619dc7 commit 02ea622
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions aether-kernel/aether/kernel/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.

import logging
import time

from django.conf import settings
Expand All @@ -28,6 +29,8 @@
from . import models, redis

REDIS_TASK = TaskHelper(settings)
logger = logging.getLogger(__name__)
logger.setLevel(settings.LOGGING_LEVEL)


def safe_sleep():
Expand Down Expand Up @@ -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}')

0 comments on commit 02ea622

Please sign in to comment.