forked from 0xWheatyz/SPARC
Persist async job state to PostgreSQL so batch results survive API restarts #405
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?
Summary
The
_jobsdict is in-memory only. Job state is lost whenever the API process restarts, leaving clients unable to retrieve results for in-flight or completed jobs.What to do
jobstable in PostgreSQL (or reuse an existing migration system) with columns:id,status,created_at,updated_at,result(JSONB),error_jobsdict with database queriesrunningat shutdown should be markedfailedwith a descriptive error message/jobs/{job_id}GET endpoint (or update the existing one) to read from the DBAcceptance Criteria
runningstate at startup are transitioned tofailedautomaticallyReference
Roadmap: P1 - Error handling and resilience
Triage: Already Implemented
After reviewing the codebase, this issue has already been fully implemented in the current
mainbranch.This issue can be closed.