Skip to content

Commit 4e0cf4b

Browse files
ulgensrzelazo
andcommitted
Fixed incompatibility with django_redis >= 4.12.0
Fixed bug caused by trying to use global level logger variable from django_redis.cache that has been moved to django_redis.cache.RedisCache instance attribute since django_redis 4.12.0 release. Co-authored-by: rzelazo <62251572+rzelazo@users.noreply.github.com>
1 parent 82b1dbc commit 4e0cf4b

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

django_prometheus/cache/backends/redis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get(self, key, default=None, version=None, client=None):
2121
django_cache_get_fail_total.labels(backend="redis").inc()
2222
if self._ignore_exceptions:
2323
if self._log_ignored_exceptions:
24-
cache.logger.error(str(e))
24+
self.logger.error(str(e))
2525
return default
2626
raise
2727
else:

0 commit comments

Comments
 (0)