Skip to content

Commit

Permalink
feat: Allow 2 minutes for postinstall actions if silentinstall flag i…
Browse files Browse the repository at this point in the history
…s passed, increase uninstall timeout
  • Loading branch information
ghost1face committed Nov 27, 2023
1 parent 428d045 commit ec887ac
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Squirrel/UpdateManager.ApplyReleases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,16 @@ async Task invokePostInstall(SemanticVersion currentVersion, bool isInitialInsta
// For each app, run the install command in-order and wait
if (!firstRunOnly) await squirrelApps.ForEachAsync(async exe => {
using (var cts = new CancellationTokenSource()) {
cts.CancelAfter(30 * 1000);
// if silent install, allow more time
// to ensure all parts are being configured
// this is likely being installed at startup
// which we could have contention with other processes on start
if (silentInstall) {
cts.CancelAfter(120 * 1000);
}
else {
cts.CancelAfter(60 * 1000);
}

try {
await Utility.InvokeProcessAsync(exe, args, cts.Token);
Expand Down Expand Up @@ -616,7 +625,7 @@ await toCleanup.ForEachAsync(async x => {
// For each app, run the install command in-order and wait
await squirrelApps.ForEachAsync(async exe => {
using (var cts = new CancellationTokenSource()) {
cts.CancelAfter(20 * 1000);
cts.CancelAfter(30 * 1000);

try {
await Utility.InvokeProcessAsync(exe, args, cts.Token);
Expand Down

0 comments on commit ec887ac

Please sign in to comment.