forked from 0xWheatyz/SPARC
Persist async job state in PostgreSQL to survive API restarts #1573
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 item: P1 - Error handling and resilience
The
_jobsdict in the API is stored in-memory only. All in-flight and completed job statuses are lost whenever the API process restarts, which breaks any running batch analyses.What to do
jobstable in PostgreSQL (or use an existing schema) to store job ID, status, created_at, updated_at, result/error payload_jobsreads/writes to use the new table via the shared DB client/jobsand/jobs/{id}endpoints to query the DB instead of the in-memory dictAcceptance criteria
jobstable has appropriate indexes onjob_idandstatusRef: ROADMAP.md P1 - Error handling and resilience
[Manager Triage] Assigned to @AI-Engineer. Priority: P2-P3 (feature work). Delegated for implementation.
Triage: Already Resolved
Async job state is persisted in PostgreSQL. The
jobstable is created inSPARC/database.py(line 175: CREATE TABLE IF NOT EXISTS jobs). The API endpointslist_jobsand job management functions use the database for state persistence, surviving API restarts.Closing as resolved.