From 3b9d54231bdf2b5ed2c872157e70edf4e0c89868 Mon Sep 17 00:00:00 2001 From: sascha Date: Sat, 18 Apr 2026 10:26:30 +0200 Subject: [PATCH] Fix: non-blocking vault sync on startup --- app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 8c18d23..7ef6c04 100644 --- a/app.py +++ b/app.py @@ -91,9 +91,10 @@ async def _periodic_vault_sync(): @asynccontextmanager async def lifespan(app: FastAPI): - # Startup: sync vault, fall back to disk cache - if not _sync_vault(): - _load_disk_cache() + # Startup: try vault sync in background, use file fallback immediately + _load_disk_cache() + loop = asyncio.get_event_loop() + loop.run_in_executor(None, _sync_vault) # non-blocking task = asyncio.create_task(_periodic_vault_sync()) yield task.cancel()