Skip to content

Commit

Permalink
fix: correctly respect max-pull-attempt-* options
Browse files Browse the repository at this point in the history
  • Loading branch information
porridge committed Dec 5, 2024
1 parent af6c094 commit d1e5a2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ func pullImageWithRetries(ctx context.Context, logger *slog.Logger, wg *sync.Wai
return
}
// Be exponentially more patient on each attempt, but prevent overflows.
attemptTimeout = min(attemptTimeout*2, timing.MaxPullAttemptDelay)
attemptTimeout = min(attemptTimeout*2, timing.MaxPullAttemptTimeout)
logger.InfoContext(ctx, "sleeping before retry", "timeout", delay)
time.Sleep(delay)
delay = delay * 2
delay = min(delay*2, timing.MaxPullAttemptDelay)
}
}

Expand Down
4 changes: 3 additions & 1 deletion internal/metrics/tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/stackrox/image-prefetcher/internal/metrics/tools

go 1.20
go 1.21

toolchain go1.22.1

require (
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1
Expand Down

0 comments on commit d1e5a2b

Please sign in to comment.