Skip to content

Commit

Permalink
allow cache disablement
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakan committed May 10, 2024
1 parent 1315953 commit 1249c16
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
4.5
----
* disable/enable cache with enviroment variable CASHE_DISABLED

4.4
----
* added action point filter
Expand Down
2 changes: 1 addition & 1 deletion src/etools_datamart/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME = "etools-datamart"
VERSION = __version__ = "4.4"
VERSION = __version__ = "4.5"
__author__ = ""
8 changes: 8 additions & 0 deletions src/etools_datamart/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
AZURE_STORAGE_ACCESS_MODE=(str, "r"),
AZURE_STORAGE_ACCESS_TTL=(int, 60 * 60 * 24),
AZURE_TENANT=(str, ""),
CACHE_DISABLED=(bool, False),
CACHE_URL=(str, "redis://127.0.0.1:6379/1"),
CACHE_URL_API=(str, "redis://127.0.0.1:6379/2?key_prefix=api"),
CACHE_URL_LOCK=(str, "redis://127.0.0.1:6379/2?key_prefix=lock"),
Expand Down Expand Up @@ -227,6 +228,13 @@
"api": env.cache("CACHE_URL_API"),
}

if env("CACHE_DISABLED"):
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.dummy.DummyCache",
}
}

ROOT_URLCONF = "etools_datamart.config.urls"

# Python dotted path to the WSGI application used by Django's runserver.
Expand Down

0 comments on commit 1249c16

Please sign in to comment.