From 07403f690a6b155db963dfeedc9e7e9a4d8fa22a Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Tue, 28 Jan 2025 19:19:34 +0100 Subject: [PATCH] Fix #18515: Don't fail in DEBUG mode When no Redis server is reachable management commands failed without this try...except block. --- netbox/core/apps.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/netbox/core/apps.py b/netbox/core/apps.py index 9674860b9..b1337c7ed 100644 --- a/netbox/core/apps.py +++ b/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