insoln avatar

job-restart-feature

Job restart workflow for Slack-MM2 Sync (POST /api/jobs/{job_id}/restart), including backend behavio

提供方 insoln|开源

Job Restart Feature

When to use

  • Implementing or debugging “retry failed/skipped entities” flows
  • Adjusting export orchestrator behavior for restarted jobs
  • Updating frontend job card UX around restart
  • Writing/maintaining unit/integration tests for restart

API contract

Endpoint:

  • POST /jobs/{job_id}/restart (also available as /api/jobs/{job_id}/restart)

Behavior (high level):

  • Only completed jobs can be restarted
  • Resets failed/skipped entities back to pending
  • Clears their error messages
  • Triggers export orchestrator for that job
  • Successful entities are not reset

UI behavior

  • Restart button appears only when:
    • job is completed (success or failed), and
    • there are retryable entities (failed or skipped)

Testing expectations

  • Unit tests cover: not found, invalid status, no retryables, success path
  • Integration tests validate end-to-end restart + export trigger

Source of truth