@@ -305,7 +305,7 @@ await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath)
305
305
Title = Context . API . GetTranslation ( "plugin_pluginsmanager_update_all_title" ) ,
306
306
SubTitle = Context . API . GetTranslation ( "plugin_pluginsmanager_update_all_subtitle" ) ,
307
307
IcoPath = icoPath ,
308
- Action = e =>
308
+ AsyncAction = async e =>
309
309
{
310
310
string message ;
311
311
if ( Settings . AutoRestartAfterChanging )
@@ -326,11 +326,11 @@ await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath)
326
326
return false ;
327
327
}
328
328
329
- Parallel . ForEach ( resultsForUpdate , plugin =>
329
+ await Task . WhenAll ( resultsForUpdate . Select ( async plugin =>
330
330
{
331
331
var downloadToFilePath = Path . Combine ( Path . GetTempPath ( ) , $ "{ plugin . Name } -{ plugin . NewVersion } .zip") ;
332
332
333
- _ = Task . Run ( async delegate
333
+ try
334
334
{
335
335
if ( File . Exists ( downloadToFilePath ) )
336
336
{
@@ -341,18 +341,17 @@ await Http.DownloadAsync(plugin.PluginNewUserPlugin.UrlDownload, downloadToFileP
341
341
. ConfigureAwait ( false ) ;
342
342
343
343
PluginManager . UpdatePlugin ( plugin . PluginExistingMetadata , plugin . PluginNewUserPlugin , downloadToFilePath ) ;
344
-
345
- } ) . ContinueWith ( t =>
344
+ }
345
+ catch ( Exception ex )
346
346
{
347
- Log . Exception ( "PluginsManager" , $ "Update failed for { plugin . Name } ",
348
- t . Exception . InnerException ) ;
347
+ Log . Exception ( "PluginsManager" , $ "Update failed for { plugin . Name } ", ex . InnerException ) ;
349
348
Context . API . ShowMsg (
350
349
Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_title" ) ,
351
350
string . Format (
352
351
Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_subtitle" ) ,
353
352
plugin . Name ) ) ;
354
- } , TaskContinuationOptions . OnlyOnFaulted ) ;
355
- } ) ;
353
+ }
354
+ } ) ) ;
356
355
357
356
if ( Settings . AutoRestartAfterChanging )
358
357
{
0 commit comments