Parcourir la source

Fix #18515: Don't fail in DEBUG mode

When no Redis server is reachable management commands failed without
this try...except block.
Tobias Genannt il y a 1 an
Parent
commit
07403f690a
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      netbox/core/apps.py

+ 4 - 1
netbox/core/apps.py

@@ -28,4 +28,7 @@ class CoreConfig(AppConfig):
 
         # Clear Redis cache on startup in development mode
         if settings.DEBUG:
-            cache.clear()
+            try:
+                cache.clear()
+            except Exception:
+                pass