mirror of
https://github.com/netbox-community/netbox.git
synced 2025-09-06 14:23:36 -06:00
Fixes: #19825 - Prevent cache for config revisions from being overwritten when in debug mode when not intended
This commit is contained in:
parent
9580ac2946
commit
663f9a223d
@ -42,6 +42,13 @@ class CoreConfig(AppConfig):
|
|||||||
# Clear Redis cache on startup in development mode
|
# Clear Redis cache on startup in development mode
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
try:
|
try:
|
||||||
|
config = cache.get('config')
|
||||||
|
config_version = cache.get('config_version')
|
||||||
cache.clear()
|
cache.clear()
|
||||||
|
if config_version:
|
||||||
|
# Activate the current config revision
|
||||||
|
# Do not query DB due to apps still initializing
|
||||||
|
cache.set('config', config, None)
|
||||||
|
cache.set('config_version', config_version, None)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user