mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
* Clear Swagger API cache on startup * Clear entire Redis cache on startup if DEBUG=True
This commit is contained in:
parent
bd5e7a8d1a
commit
dbaa9c1ce1
@ -1,4 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
from django.conf import settings
|
||||
from django.core.cache import cache
|
||||
from django.db import models
|
||||
from django.db.migrations.operations import AlterModelOptions
|
||||
|
||||
@ -22,3 +24,7 @@ class CoreConfig(AppConfig):
|
||||
|
||||
# Register models
|
||||
register_models(*self.get_models())
|
||||
|
||||
# Clear Redis cache on startup in development mode
|
||||
if settings.DEBUG:
|
||||
cache.clear()
|
||||
|
Loading…
Reference in New Issue
Block a user