Skip to content

Commit 33c4007

Browse files
authored
Merge pull request #29997 from peppy/async-wait-exit-velopack
Update velopack and switch to using async version of `WaitExitThenApplyUpdates`
2 parents f16f419 + df0966a commit 33c4007

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

osu.Desktop/Updater/VelopackUpdateManager.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
6666
{
6767
Activated = () =>
6868
{
69-
restartToApplyUpdate();
69+
Task.Run(restartToApplyUpdate);
7070
return true;
7171
}
7272
});
@@ -88,7 +88,11 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
8888
{
8989
notification = new UpdateProgressNotification
9090
{
91-
CompletionClickAction = restartToApplyUpdate,
91+
CompletionClickAction = () =>
92+
{
93+
Task.Run(restartToApplyUpdate);
94+
return true;
95+
},
9296
};
9397

9498
Schedule(() => notificationOverlay.Post(notification));
@@ -127,13 +131,10 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
127131
return true;
128132
}
129133

130-
private bool restartToApplyUpdate()
134+
private async Task restartToApplyUpdate()
131135
{
132-
// TODO: Migrate this to async flow whenever available (see https://github.com/ppy/osu/pull/28743#discussion_r1740505665).
133-
// Currently there's an internal Thread.Sleep(300) which will cause a stutter when the user clicks to restart.
134-
updateManager.WaitExitThenApplyUpdates(pendingUpdate?.TargetFullRelease);
136+
await updateManager.WaitExitThenApplyUpdatesAsync(pendingUpdate?.TargetFullRelease).ConfigureAwait(false);
135137
Schedule(() => game.AttemptExit());
136-
return true;
137138
}
138139
}
139140
}

osu.Desktop/osu.Desktop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<ItemGroup Label="Package References">
2727
<PackageReference Include="System.IO.Packaging" Version="8.0.0" />
2828
<PackageReference Include="DiscordRichPresence" Version="1.2.1.24" />
29-
<PackageReference Include="Velopack" Version="0.0.598-g933b2ab" />
29+
<PackageReference Include="Velopack" Version="0.0.626" />
3030
</ItemGroup>
3131
<ItemGroup Label="Resources">
3232
<EmbeddedResource Include="lazer.ico" />

0 commit comments

Comments
 (0)