@@ -321,34 +321,33 @@ await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath)
321
321
Context . API . GetTranslation ( "plugin_pluginsmanager_update_title" ) ,
322
322
MessageBoxButton . YesNo ) == MessageBoxResult . Yes )
323
323
{
324
- foreach ( var plugin in resultsForUpdate )
324
+ Parallel . ForEach ( resultsForUpdate , plugin =>
325
325
{
326
- var downloadToFilePath = Path . Combine ( Path . GetTempPath ( ) ,
327
- $ "{ plugin . Name } -{ plugin . NewVersion } .zip") ;
326
+ var downloadToFilePath = Path . Combine ( Path . GetTempPath ( ) , $ "{ plugin . Name } -{ plugin . NewVersion } .zip") ;
328
327
329
328
_ = Task . Run ( async delegate
329
+ {
330
+ if ( File . Exists ( downloadToFilePath ) )
330
331
{
331
- if ( File . Exists ( downloadToFilePath ) )
332
- {
333
- File . Delete ( downloadToFilePath ) ;
334
- }
332
+ File . Delete ( downloadToFilePath ) ;
333
+ }
335
334
336
- await Http . DownloadAsync ( plugin . PluginNewUserPlugin . UrlDownload , downloadToFilePath )
337
- . ConfigureAwait ( false ) ;
335
+ await Http . DownloadAsync ( plugin . PluginNewUserPlugin . UrlDownload , downloadToFilePath )
336
+ . ConfigureAwait ( false ) ;
338
337
339
- PluginManager . UpdatePlugin ( plugin . PluginExistingMetadata , plugin . PluginNewUserPlugin , downloadToFilePath ) ;
338
+ PluginManager . UpdatePlugin ( plugin . PluginExistingMetadata , plugin . PluginNewUserPlugin , downloadToFilePath ) ;
340
339
341
- } ) . ContinueWith ( t =>
342
- {
343
- Log . Exception ( "PluginsManager" , $ "Update failed for { plugin . Name } ",
344
- t . Exception . InnerException ) ;
345
- Context . API . ShowMsg (
346
- Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_title" ) ,
347
- string . Format (
348
- Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_subtitle" ) ,
349
- plugin . Name ) ) ;
350
- } , TaskContinuationOptions . OnlyOnFaulted ) ;
351
- }
340
+ } ) . ContinueWith ( t =>
341
+ {
342
+ Log . Exception ( "PluginsManager" , $ "Update failed for { plugin . Name } ",
343
+ t . Exception . InnerException ) ;
344
+ Context . API . ShowMsg (
345
+ Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_title" ) ,
346
+ string . Format (
347
+ Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_subtitle" ) ,
348
+ plugin . Name ) ) ;
349
+ } , TaskContinuationOptions . OnlyOnFaulted ) ;
350
+ } ) ;
352
351
353
352
if ( Settings . AutoRestartAfterChanging )
354
353
{
0 commit comments