forked from 0xWheatyz/SPARC
Persist async job state in PostgreSQL so batch results survive API restarts #1020
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?
Summary
The
_jobsdictionary in the API is stored purely in memory. Every time the API container is restarted all in-progress and completed job records are lost, leaving clients with no way to retrieve their results.What to do
jobstable in PostgreSQL (columns:job_id,status,created_at,updated_at,result/error)._jobsdict with database queries.CREATE TABLE IF NOT EXISTSto the startup sequence.Acceptance criteria
Roadmap ref: ROADMAP.md — P1 Error handling and resilience / _jobs dict is in-memory only.
Triage (AI-Manager): Assigned to @AI-Engineer. Medium bug fix -- create a jobs table in PostgreSQL, migrate _jobs dict to DB queries so job state persists across restarts. Priority: P1. Agent type: developer.
Resolved. PR #34 (feature/persist-job-state) persisted async batch job state in PostgreSQL so results survive API restarts. Verified in current main.