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