-
Notifications
You must be signed in to change notification settings - Fork 27
fix: retry artifacts download #342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: retry artifacts download #342
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @nestoracunablanco - I've reviewed your changes - here's some feedback:
- Introduce a delay (e.g., exponential backoff) between retry attempts to avoid hammering the download endpoint.
- Use a warning log or include the current attempt number in the retry log to improve observability when downloads fail repeatedly.
- Extract the hardcoded retry count into a constant or configuration to make retry behavior easier to adjust.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
88a0aa6
to
2aef28b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
PTAL @jcanocan
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 0xFelix The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
cmd/medius/images/push.go
Outdated
func (b *buildAndPublish) getArtifactReader(artifactInfo *api.ArtifactDetails) (http.ReadCloserWithChecksum, error) { | ||
var artifactReader http.ReadCloserWithChecksum | ||
var err error | ||
for range 3 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please use a const here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Nestor Acuna Blanco <[email protected]>
2aef28b
to
099d640
Compare
/lgtm |
Release note: