File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Plugins/Flow.Launcher.Plugin.PluginsManager Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ namespace Flow.Launcher.Plugin.PluginsManager
17
17
{
18
18
internal class PluginsManager
19
19
{
20
- const string zip = "zip" ;
20
+ private static readonly HttpClient HttpClient = new ( ) ;
21
+
22
+ private const string zip = "zip" ;
21
23
22
24
private PluginInitContext Context { get ; set ; }
23
25
@@ -151,8 +153,7 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
151
153
if ( File . Exists ( filePath ) )
152
154
File . Delete ( filePath ) ;
153
155
154
- using var httpClient = new HttpClient ( ) ;
155
- using var response = await httpClient . GetAsync ( plugin . UrlDownload , HttpCompletionOption . ResponseHeadersRead ) . ConfigureAwait ( false ) ;
156
+ using var response = await HttpClient . GetAsync ( plugin . UrlDownload , HttpCompletionOption . ResponseHeadersRead ) . ConfigureAwait ( false ) ;
156
157
157
158
response . EnsureSuccessStatusCode ( ) ;
158
159
@@ -165,7 +166,7 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
165
166
{
166
167
if ( prgBox != null )
167
168
{
168
- httpClient . CancelPendingRequests ( ) ;
169
+ HttpClient . CancelPendingRequests ( ) ;
169
170
downloadCancelled = true ;
170
171
prgBox = null ;
171
172
}
You can’t perform that action at this time.
0 commit comments