forked from 0xWheatyz/SPARC
Persist async job state in PostgreSQL so job results survive API restarts #1500
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
_jobsdictionary is an in-memory store. Any API restart or crash wipes all pending and completed job status, leaving clients with no way to retrieve results.What to do
jobstable in PostgreSQL with columns:job_id,status,created_at,updated_at,result(JSONB),error._jobsdict with database queries.CREATE TABLE IF NOT EXISTS).GET /jobs,GET /jobs/{id}) still return the same response shape.Acceptance criteria
jobstable[Repo Manager] This issue is already resolved. Job state is persisted in PostgreSQL via
db.create_job(),db.get_job(),db.update_job(), anddb.list_jobs(). The lifespan handler marks stale jobs as failed on startup viadb.mark_stale_jobs_failed(). Closing as complete.