Skip to content

Commit a75d128

Browse files
committed
hotfix(operator): retry logic for batches download
1 parent 0987620 commit a75d128

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

operator/pkg/s3.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@ func (o *Operator) getBatchFromDataService(ctx context.Context, batchURL string,
2121
for attempt := 0; attempt < maxRetries; attempt++ {
2222
if attempt > 0 {
2323
o.Logger.Infof("Waiting for %s before retrying data fetch (attempt %d of %d)", retryDelay, attempt+1, maxRetries)
24-
select {
25-
case <-time.After(retryDelay):
26-
// Wait before retrying
27-
case <-ctx.Done():
28-
return nil, ctx.Err()
29-
}
24+
time.Sleep(retryDelay)
3025
retryDelay *= 2 // Exponential backoff. Ex: 5s, 10s, 20s
3126
}
3227

0 commit comments

Comments
 (0)