Fix dashboard database initialization using temp file instead of in-memory

This commit is contained in:
2025-10-27 17:34:45 +00:00
parent 328ef1b88d
commit 07f446dda8

View File

@@ -109,8 +109,12 @@ def init_session_state() -> None:
st.session_state.instruments = InstrumentFactory.create(config) st.session_state.instruments = InstrumentFactory.create(config)
if "repository" not in st.session_state: if "repository" not in st.session_state:
# Create test repository (in-memory for dashboard demo) # Create test repository (temporary file for dashboard demo)
st.session_state.repository = SQLiteRepository(":memory:") import os
import tempfile
tmpdir = tempfile.gettempdir()
db_path = os.path.join(tmpdir, "py_dvt_ate_dashboard.db")
st.session_state.repository = SQLiteRepository(db_path)
if "test_runner" not in st.session_state: if "test_runner" not in st.session_state:
st.session_state.test_runner = TestRunner(st.session_state.repository) st.session_state.test_runner = TestRunner(st.session_state.repository)