-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: use local cache for storing tag information #201
Conversation
CoverItUp Report
Commits HistoryUpto Users HistoryUpto |
a0caa73
to
99ea1a1
Compare
CoverItUp ReportComparison Table - 7 Types 📈
Commits HistoryUpto Users HistoryUpto |
Ok so you want to get rid of raw GitHub user json and replace it with the GitHub api. |
Just keep the raw GitHub user content. It never gave us any problems. |
99ea1a1
to
c31e0c5
Compare
Yes, I had doubts about that. Returned the prepared json back. |
CoverItUp ReportComparison Table - 7 Types 📈
Commits HistoryUpto Users HistoryUpto |
} | ||
|
||
// cache for 20 minutes | ||
if time.Now().UTC().After(timestamp.Add(20 * time.Minute)) { |
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.
Just a thought. May be an option as --no-cache
on cli to not use cache might do some good?
Or an option --clean-cache
to bust the current cache.
It is 20 mins so no problems but might be a good compliance addition.
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.
Yes, it will need to be added. There is also an idea to configure the cache time. Leave 20 minutes by default, but with the ability to set any value.
I created a separate task so I wouldn't forget: #202
Fixed: #199
Since we add a local cache for 20 minutes to store information about golang tags, we can safely access the github api for information about tags. At the same time, we will not receive errors like too many requests.
Currently, the storage time in the cache is strictly specified in the program code and is 20 minutes. It is probably worth considering the ability to change this parameter in the future. If you consider it necessary, you can implement this in the current PR.
Also, adding a file with a local cache allows you to independently prepare this file in a number of environments and put it in the gobrew working directory. This will avoid additional requests to Github for tags. This is for question #197
I tested this solution locally.