fix: backfill database on startup

This commit is contained in:
2026-05-18 15:40:58 +08:00
parent c626ec51d6
commit c2e9558f5b

View File

@@ -916,6 +916,12 @@ async def lifespan(_: FastAPI):
message="服务重启 · 上次音频处理已中断,可重新处理", message="服务重启 · 上次音频处理已中断,可重新处理",
) )
JOBS[p.name] = job JOBS[p.name] = job
ensure_job_document_fields(job)
if DB:
try:
DB.sync_job(job.model_dump(mode="json"), p)
except Exception as e:
print(f"[database restore sync failed] job={job.id} error={e}", flush=True)
except Exception: except Exception:
pass pass
yield yield