forked from 0xWheatyz/SPARC
Persist async job state in PostgreSQL to survive API restarts #1549
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
The
_jobsdictionary in the API is held in process memory. Every API restart wipes all in-flight and completed job results, making batch analysis unreliable in a containerised environment.Roadmap reference: ROADMAP.md > P1 > Error handling and resilience > _jobs dict is in-memory only
What to do
jobstable to the PostgreSQL schema (columns:id,status,created_at,updated_at,resultJSONB,errorTEXT)._jobswith database queries.GET /jobs/{job_id}andGET /jobsendpoints to query the database.Acceptance criteria
GET /jobs/{job_id}still returns the correct status and result._jobsin-memory dict is fully removed.This issue has been resolved. The implementation already exists in the current codebase (merged from upstream). Verified by repo manager during triage on 2026-04-19.