Fix: resolved sqlite concurrency errors (table users already exists) by moving DDL to explicit async initialize() and implementing lazy singleton dependency.

This commit is contained in:
2026-04-12 07:59:45 -04:00
parent b2e4706a14
commit 03f5a7826f
7 changed files with 45 additions and 41 deletions

View File

@@ -14,8 +14,10 @@ from ..conftest import _FUZZ_SETTINGS
@pytest.fixture
def repo(tmp_path):
return get_repository(db_path=str(tmp_path / "histogram_test.db"))
async def repo(tmp_path):
r = get_repository(db_path=str(tmp_path / "histogram_test.db"))
await r.initialize()
return r
def _log(decky="d", service="ssh", ip="1.2.3.4", timestamp=None):

View File

@@ -10,8 +10,10 @@ from .conftest import _FUZZ_SETTINGS
@pytest.fixture
def repo(tmp_path):
return get_repository(db_path=str(tmp_path / "test.db"))
async def repo(tmp_path):
r = get_repository(db_path=str(tmp_path / "test.db"))
await r.initialize()
return r
@pytest.mark.anyio