diff --git a/v2rayN/ServiceLib/Services/SpeedtestService.cs b/v2rayN/ServiceLib/Services/SpeedtestService.cs index 05de5b02..e9ab1344 100644 --- a/v2rayN/ServiceLib/Services/SpeedtestService.cs +++ b/v2rayN/ServiceLib/Services/SpeedtestService.cs @@ -141,8 +141,7 @@ namespace ServiceLib.Services } })); } - Task.WaitAll([.. tasks]); - await Task.CompletedTask; + await Task.WhenAll(tasks); } private async Task RunRealPingBatchAsync(List lstSelected, string exitLoopKey, int pageSize = 0) @@ -216,7 +215,7 @@ namespace ServiceLib.Services await DoRealPing(downloadHandle, it); })); } - Task.WaitAll(tasks.ToArray()); + await Task.WhenAll(tasks); } catch (Exception ex) { @@ -291,7 +290,7 @@ namespace ServiceLib.Services } })); } - Task.WaitAll(tasks.ToArray()); + await Task.WhenAll(tasks); } private async Task DoRealPing(DownloadService downloadHandle, ServerTestItem it)