fix: backfill database on startup
This commit is contained in:
@@ -916,6 +916,12 @@ async def lifespan(_: FastAPI):
|
||||
message="服务重启 · 上次音频处理已中断,可重新处理",
|
||||
)
|
||||
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:
|
||||
pass
|
||||
yield
|
||||
|
||||
Reference in New Issue
Block a user