added env dependent storage type

This commit is contained in:
Brian Bjarke Jensen
2024-02-24 21:54:36 +01:00
parent e7d91a4886
commit 47cae849ff
+9 -2
View File
@@ -1,9 +1,16 @@
from dash import html, dcc
import logging
import os
storage_type = "session"
if "ENV" in os.environ and os.getenv("ENV") == "DEV":
storage_type = "memory"
logging.info(f"ENV=DEV -> dcc.Stores changed to storage_type={storage_type}")
stores_element = html.Div(
children=[
dcc.Store(id="alert-message", storage_type="session"),
dcc.Store(id="visual-communication-name", storage_type="session"),
dcc.Store(id="alert-message", storage_type=storage_type, data=""),
dcc.Store(id="vis-com-name", storage_type=storage_type, data=""),
]
)