-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Download new API files once per Homebrew instance #20619
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
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.
Thanks! Good to merge as-is but would be nice to cleanup as follow-up.
74a2487 to
85d76d1
Compare
|
I pushed a new, much simpler approach. Now, use environment variables to indicate when a download has already occurred. This is preferable because it will apply to any sub-processes as well (e.g. any Also, to clarify why Note: I haven't tested this thoroughly yet on my machine, but I will before merging |
9e2ec79 to
c31be49
Compare
c31be49 to
262d9cc
Compare
262d9cc to
00f9601
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.
Thanks, this approach makes sense, appreciate the patience here, nice work @Rylan12!
|
Thanks for the help and iteration here @MikeMcQuaid! |
For consistency, we don’t want to download new API files mid-run, even if new data is available on the server. This PR modifies the API fetcher logic to only attempt to fetch the data once per execution.
To clarify why
mtimeand--time-condare insufficient here: these checks simply ensure that enough time has passed in between fetches, and that a new fetch will actually yield a new file. However, when building from source, it's possible that an installation will take long enough that new data is available and enough time has passed thatHomebrew::APIconsiders the file to be stale. This means that future calls to API data will try to download the data once again, which is what this PR is attempting to prevent.