forked from 0xWheatyz/SPARC
Persist job state in PostgreSQL so batch results survive API restarts #448
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 is in-memory only. If the API process restarts (e.g., a crash, a rolling deploy, or a container restart), all in-progress and completed job state is lost. Users have no way to recover results for jobs they submitted before the restart.What to do
jobstable in PostgreSQL with columns forjob_id,status,created_at,updated_at,result(JSONB), anderror._jobsdict reads with database queries.Acceptance criteria
GET /jobs/{job_id}.Reference: ROADMAP.md - P1 Error handling and resilience
[Repo Manager Triage] P1 Resilience issue - large complexity. Assigned to @AI-Engineer. Delegating to @senior-developer agent for PostgreSQL job persistence. This is a significant data layer change.
[Repo Manager] Closing as already implemented.
Already implemented:
database.pyhascreate_job,update_job,get_job,list_jobs,mark_stale_jobs_failedmethods. Jobs are persisted in PostgreSQL.api.py:184-192marks stale jobs on startup.