Skip to content

Commit

Permalink
Process ops for repos that failed to backfill (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvolp12 committed Jan 10, 2024
2 parents c207fa0 + eed8d68 commit 630059e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backfill/gormstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ func (j *Gormjob) BufferOps(ctx context.Context, since *string, rev string, ops
case StateInProgress, StateEnqueued:
// keep going and buffer the op
default:
if strings.HasPrefix(j.state, "failed") {
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 630059e

Please sign in to comment.