forked from 0xWheatyz/SPARC
Persist async job state in PostgreSQL so batch results survive API restarts #1072
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Roadmap reference: P1 / Error handling and resilience
The
_jobsdictionary in the API server is in-memory only. Any in-flight or completed batch job state is lost whenever the API process restarts, giving users no way to retrieve their results.What to do
jobstable in PostgreSQL (or reuse an existing schema) with columns for job ID, status, created/updated timestamps, result payload, and error message._jobsdict with database queries.completedorfailed.runningjobs found at startup asfailed(since the process that was running them is gone).Acceptance criteria
GET /jobs/{job_id}returns correct status after a restart.failedwith an explanatory message.jobstable automatically.Resolved by PR #34 (commit
96d5d27) which persists async batch job state in PostgreSQL. Closing as complete.