perf(scoop-update): Check for running process before wasting time on download #5799
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR simply moves the check for an existing running process to BEFORE the download of the new version. This saves time especially on larger application downloads and slower connections.
Description
As stated, I've simply moved the
test_running_process
call to before the download of the application.Motivation and Context
This change was motivated by an instance where I attempted to
scoop update *
and some of the applications were still running. To speed this up, it seemed reasonable to skip the update process for running applications. If and until it's possible to reliably update a running application, this seems a reasonable stop-gap to improve update performance of applications that can be updated.This relates tangentially to #1372 as the update process will at least avoid the pointless download time if the application is running.
How Has This Been Tested?
I ran this locally using
scoop update keepass
while keepass was running. After my change, everything ran as expected and the running process information was shown, bypassing the download step.Checklist:
develop
branch.