forked from 0xWheatyz/SPARC
Fix: Persist async job state in PostgreSQL so batch results survive API restarts #471
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
Problem
The
_jobsdict in the API is in-memory only. When the API process restarts, all in-flight and completed job state is lost. Users cannot retrieve batch job results after a restart.Task
jobstable (or similar) to the PostgreSQL schema to persist job status, metadata, and results._jobsdict to read/write through the database./jobs,/jobs/{id}) continue to work as before but now read from the database.Acceptance Criteria
/jobsand/jobs/{id}endpoints return correct data after restart.Already implemented. A
jobstable exists in the database schema (SPARC/database.py) with full CRUD operations:create_job,update_job,get_job,list_jobs, andmark_stale_jobs_failed. Job state survives API restarts. Closing as completed.