forked from 0xWheatyz/SPARC
Persist batch job state in PostgreSQL so job results survive API restarts #494
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. Any API restart wipes all job status, leaving clients with orphaned job IDs and no way to retrieve results.Task
jobstable in PostgreSQL with columns for job ID, status, created_at, updated_at, result (JSONB), and error message/jobs/{job_id}and/jobslist endpoints to read from DB instead of (or in addition to) the in-memory dictAcceptance Criteria
/jobs/{job_id}returns the correct status and result_jobsin-memory dict is either removed or serves only as a write-through cacheTriage: P1 Error handling/resilience. Assigned to @AI-Engineer (senior-developer). Medium scope - requires new
jobstable schema, migration, and refactoring in-memory dict to PostgreSQL. Delegated to @senior-developer agent.Resolved: Batch job state is persisted in PostgreSQL via db.create_job, db.update_job, db.get_job, and db.list_jobs. Stale jobs are marked as failed on startup.
Closing as resolved -- the implementation is merged into main.