Skip to content

Commit 8680d23

Browse files
committed
Add cache checks
1 parent 37b9575 commit 8680d23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

simple_health_check/checks/caches.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import Optional
22

33
from django.core.cache import CacheKeyWarning, caches
4+
from django.conf import settings
45

56
from . import BaseHealthCheck
67
from ..exceptions import HealthCheckError
@@ -15,7 +16,7 @@ def check(self):
1516
if self.alias:
1617
caches[self.alias]
1718
try:
18-
for alias in caches:
19+
for alias in getattr(settings, 'CACHES', {}).keys():
1920
if self.alias and alias != self.alias:
2021
continue
2122

0 commit comments

Comments
 (0)