Fix plugin update race condition

This commit is contained in:
Brant Martin
2020-02-23 00:27:09 -05:00
parent 86b6b94d25
commit d3de1426b2

View File

@@ -280,7 +280,7 @@ namespace Torch.Managers
{ {
_log.Info("Checking for plugin updates..."); _log.Info("Checking for plugin updates...");
var count = 0; var count = 0;
Task.WhenAll(plugins.Select(async item => Task.WaitAll(plugins.Select(async item =>
{ {
try try
{ {
@@ -321,7 +321,7 @@ namespace Torch.Managers
_log.Warn($"An error occurred updating the plugin {item.Manifest.Name}."); _log.Warn($"An error occurred updating the plugin {item.Manifest.Name}.");
_log.Warn(e); _log.Warn(e);
} }
})); }).ToArray());
_log.Info($"Updated {count} plugins."); _log.Info($"Updated {count} plugins.");
return count > 0; return count > 0;