Skip to content

Commit

Permalink
Merge pull request #2218 from jetersen/fix/recursivePending
Browse files Browse the repository at this point in the history
(#1866) Avoid recursive search for pending package removal
  • Loading branch information
gep13 authored Apr 16, 2021
2 parents 759a416 + f6530e4 commit 4b17e01
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ private void handle_message(PreRunMessage message)
{
this.Log().Debug(ChocolateyLoggers.Verbose, "[Pending] Removing all pending packages that should not be considered installed...");

var pendingFiles = _fileSystem.get_files(ApplicationParameters.PackagesLocation, ApplicationParameters.PackagePendingFileName, SearchOption.AllDirectories).ToList();
var pendingFiles = _fileSystem.get_files(ApplicationParameters.PackagesLocation, ApplicationParameters.PackagePendingFileName).ToList();
foreach (var pendingFile in pendingFiles.or_empty_list_if_null())
{
var packageFolder = _fileSystem.get_directory_name(pendingFile);
string packageFolderName = _fileSystem.get_directory_info_for(packageFolder).Name;

var pendingSkipFiles = _fileSystem.get_files(packageFolder, PENDING_SKIP_FILE, SearchOption.AllDirectories).ToList();
var pendingSkipFiles = _fileSystem.get_files(packageFolder, PENDING_SKIP_FILE).ToList();
if (pendingSkipFiles.Count != 0)
{
this.Log().Warn("Pending file found for {0}, but a {1} file was also found. Skipping removal".format_with(packageFolderName, PENDING_SKIP_FILE));
Expand Down

0 comments on commit 4b17e01

Please sign in to comment.