feat(scheduler): Add retries to job status

This adds retries as an attribute to JobStatus allowing a job to
indicate liveness to the scheduler when work has not progressed.
A job could use this and the statusThreshold passed into the Run method
to break work up into batches that would otherwise timeout if all the
work was attempted at once, for example a long running SQL delete
command.
This commit is contained in:
Michael Gaffney committed 2024-10-25 10:25:51 -04:00
1 parent 9354a4ebcf
commit 8c291a2934
10 files changed
+85 -40

No files matched your search

@@ -67,6 +67,11 @@ message JobRun {
// @inject_tag: `gorm:"default:0"`
uint32 total_count = 9;
// retries_count is set during an update to indicate the number of times
// a job has retried work.
// @inject_tag: `gorm:"default:0"`
uint32 retries_count = 12;
// status of the job run (running, completed, failed or interrupted).
// @inject_tag: `gorm:"not_null"`
string status = 10;