Skip to content

Commit 1fb7822

Browse files
authored
Fixed incompatibility with django_redis >= 4.12.0 (#416)
1 parent cf8942f commit 1fb7822

File tree

1 file changed

+2
-1
lines changed
  • django_prometheus/cache/backends

1 file changed

+2
-1
lines changed

django_prometheus/cache/backends/redis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from django.core.cache.backends.redis import RedisCache as DjangoRedisCache
22
from django_redis import cache, exceptions
33

4+
45
from django_prometheus.cache.metrics import (
56
django_cache_get_fail_total,
67
django_cache_get_total,
@@ -21,7 +22,7 @@ def get(self, key, default=None, version=None, client=None):
2122
django_cache_get_fail_total.labels(backend="redis").inc()
2223
if self._ignore_exceptions:
2324
if self._log_ignored_exceptions:
24-
cache.logger.error(str(e))
25+
self.logger.error(str(e))
2526
return default
2627
raise
2728
else:

0 commit comments

Comments
 (0)