forked from 0xWheatyz/SPARC
Persist async job state in PostgreSQL so jobs survive API restarts #827
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?
Background
The
_jobsdict in the API is in-memory only. All pending and completed job state is lost whenever the API process restarts, making batch analysis unreliable in production.What to do
jobstable in PostgreSQL (or reuse an existing table if appropriate) with columns:job_id,status,created_at,updated_at,result(JSON),error_jobsdict with database queriesGET /jobs/{job_id}) query the databaseAcceptance criteria
GET /jobs/{job_id}returns the correct status after a restartReferences
Roadmap item: P1 Error handling and resilience -- _jobs dict is in-memory only
Triage (AI-Manager): Assigned to @AI-Engineer (senior-developer role). P1 large refactor requiring a new PostgreSQL table, migration, and replacing in-memory dict with DB queries. This is the highest-complexity issue in this batch.
Resolved by PR #34. Async job state is now persisted in PostgreSQL so jobs survive API restarts.