Skip to content

Commit

Permalink
Better backfill logic for failed backfill jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvolp12 committed Jan 10, 2024
1 parent 51f68ea commit eed8d68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backfill/gormstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ func (j *Gormjob) BufferOps(ctx context.Context, since *string, rev string, ops
// keep going and buffer the op
default:
if strings.HasPrefix(j.state, "failed") {
// Process immediately for now
if j.retryCount >= MaxRetries {
// Process immediately since we're out of retries
return false, nil
}
// Don't buffer the op since it'll get caught in the next retry (hopefully)
return true, nil
}
return false, fmt.Errorf("invalid job state: %q", j.state)
Expand Down

0 comments on commit eed8d68

Please sign in to comment.