Skip to content

Commit d05fbc6

Browse files
committed
Code Quality: Run update checks in background task
Update-related service calls are now executed concurrently in a background Task to avoid blocking the main thread and improve application responsiveness during startup.
1 parent daedd10 commit d05fbc6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Files.App/Helpers/Application/AppLifecycleHelper.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,14 @@ public static async Task CheckAppUpdate()
157157
ViewedReleaseNotes = true;
158158
}
159159

160-
await updateService.CheckForUpdatesAsync();
161-
await updateService.DownloadMandatoryUpdatesAsync();
162-
await updateService.CheckAndUpdateFilesLauncherAsync();
160+
_ = Task.Run(async () =>
161+
{
162+
await Task.WhenAll(
163+
updateService.CheckForUpdatesAsync(),
164+
updateService.DownloadMandatoryUpdatesAsync(),
165+
updateService.CheckAndUpdateFilesLauncherAsync(),
166+
);
167+
});
163168
}
164169

165170
/// <summary>

0 commit comments

Comments
 (0)