Suppression du cache à chaque redémarrage
This commit is contained in:
+6
-3
@@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
from shutil import rmtree
|
||||||
|
|
||||||
import dash_bootstrap_components as dbc
|
import dash_bootstrap_components as dbc
|
||||||
import tomllib
|
import tomllib
|
||||||
@@ -32,15 +33,17 @@ app: Dash = Dash(
|
|||||||
meta_tags=META_TAGS,
|
meta_tags=META_TAGS,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
rmtree(os.getenv("CACHE_DIR", "/tmp/decp-cache"))
|
||||||
|
|
||||||
cache.init_app(
|
cache.init_app(
|
||||||
app.server,
|
app.server,
|
||||||
config={
|
config={
|
||||||
"CACHE_TYPE": "FileSystemCache",
|
"CACHE_TYPE": "FileSystemCache",
|
||||||
"CACHE_DIR": os.getenv("CACHE_DIR", "/tmp/decp-cache"),
|
"CACHE_DIR": os.getenv("CACHE_DIR", "/tmp/decp-cache"),
|
||||||
"CACHE_DEFAULT_TIMEOUT": int(
|
"CACHE_DEFAULT_TIMEOUT": int(
|
||||||
os.getenv("CACHE_DEFAULT_TIMEOUT", 3600 * 20)
|
os.getenv("CACHE_DEFAULT_TIMEOUT", 3600 * 24)
|
||||||
), # 20h par défaut
|
), # 24h par défaut
|
||||||
"CACHE_THRESHOLD": 500,
|
"CACHE_THRESHOLD": 300,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user