mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Avoid cancelling all pending requests on shared HttpClient instance
This commit is contained in:
parent
6220b34aab
commit
5016334359
1 changed files with 3 additions and 2 deletions
|
|
@ -153,7 +153,8 @@ namespace Flow.Launcher.Plugin.PluginsManager
|
|||
if (File.Exists(filePath))
|
||||
File.Delete(filePath);
|
||||
|
||||
using var response = await HttpClient.GetAsync(plugin.UrlDownload, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
|
||||
using var cts = new CancellationTokenSource();
|
||||
using var response = await HttpClient.GetAsync(plugin.UrlDownload, HttpCompletionOption.ResponseHeadersRead, cts.Token).ConfigureAwait(false);
|
||||
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
|
|
@ -166,7 +167,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
|
|||
{
|
||||
if (prgBox != null)
|
||||
{
|
||||
HttpClient.CancelPendingRequests();
|
||||
cts.Cancel();
|
||||
downloadCancelled = true;
|
||||
}
|
||||
})) != null)
|
||||
|
|
|
|||
Loading…
Reference in a new issue