-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#3237) Reduce number of queries for dependencies
When attempting to figure out what packages need to be verified/checked during a package upgrade operation, we were previously fetching information about all package versions for all "parent packages" (i.e. packages that include a dependency on the package being acted on). This causes a problem when doing something like `choco upgrade chocolatey` when you have the chromium package installed. When in this situation, due to the high number of package versions for chromium and the fact that it takes a dependency on Chocolatey, the number of queries that are emitted for Chocolatey CLI is very large. This makes it appear as though the operation has stalled, when in actual fact it is just working its way through the queries (this can be verified by looking at the requests through fiddler when this command is running). This commit attempt to address this problem by changing to only query for the latest package version (and/or the requested package version) when attempting the look up for the parent package dependencies. This greatly reduces the number of outgoing queries, but it also means that it is possible for things to not work correctly due to not all package information being available. To guard against this, a fallback has been put in place such that if the initial attempt at resolving the solution fails, it goes back and fetches information about all package versions for the parent packages, and attempt to gather the resolve the solution again. This change has been made in a way that there is some code duplication, however, based on some discussion within the team, the way that this method is written needs to be overhauled, and now is not the right time to do this. Instead, we are accepting the duplication, until some effort can be put in to overhaul this method completely.
- Loading branch information
Showing
1 changed file
with
83 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters