forked from 0xWheatyz/SPARC
Persist async job state in PostgreSQL so batch results survive API restarts #43
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?
Problem
The
_jobsdict in the API is an in-memory store. When the API process restarts (deploy, crash, scale-down), all in-flight and completed job records are lost. Callers polling/jobs/{id}receive 404s for jobs that were valid before the restart.Task
jobstable in PostgreSQL (job_id, status, created_at, updated_at, result_json, error)._jobswith queries against this table.Acceptance Criteria
/jobs/{id}._jobsdict remains in the code path.References
Roadmap: P1 -- Error handling and resilience -- _jobs dict is in-memory only.
Closing: Already implemented in PR #34 (feat(jobs): persist async batch job state in PostgreSQL). A jobs table is created in the database schema.