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

@@ -305,16 +305,18 @@ def mutate(
from decnet.mutator import mutate_decky, mutate_all, run_watch_loop
from decnet.web.dependencies import repo
if watch:
asyncio.run(run_watch_loop(repo))
return
async def _run() -> None:
await repo.initialize()
if watch:
await run_watch_loop(repo)
elif decky_name:
await mutate_decky(decky_name, repo)
elif force_all:
await mutate_all(force=True, repo=repo)
else:
await mutate_all(force=False, repo=repo)
if decky_name:
asyncio.run(mutate_decky(decky_name, repo))
elif force_all:
asyncio.run(mutate_all(force=True, repo=repo))
else:
asyncio.run(mutate_all(force=False, repo=repo))
asyncio.run(_run())
@app.command()