-
Notifications
You must be signed in to change notification settings - Fork 40
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
Use new ArtifactHub cached API #217
Conversation
Fairwinds Insights CI Report✅ No new Action Items detected! |
pkg/helm/artifacthub_cached.go
Outdated
r.Header.Add("accept", "application/json") | ||
r.Header.Set("User-Agent", ac.UserAgent) | ||
var response *http.Response | ||
for attempt := 1; attempt <= 5; attempt++ { |
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.
It'd be great if you could use some sort of exponential backoff (like https://github.com/cenkalti/backoff) or introduce a pause instead of retrying immediately a few times when something goes wrong. In some situations (like when encountering rate limit errors), this may make things even worse.
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.
Good catch! I removed the retry logic entirely. I think it's an artifact from when we originally queried the repositories themselves, which were very flaky
This PR fixes issues w/ ArtifactHub rate limiting by using the new cache API AH is providing for Nova
Checklist
Description
What's the goal of this PR?
Move to the new cached API
What changes did you make?
Added and utilized a new "cached client"
I also removed some unused fields from the old struct, to help ensure that we're getting all the data we really need
What alternative solution should we consider, if any?