Update SpeedtestService.cs

AI-optimized code
pull/6876/head
2dust 2025-03-06 14:08:29 +08:00
parent 7e8b405555
commit c374b8565b
1 changed files with 3 additions and 4 deletions

View File

@ -141,8 +141,7 @@ namespace ServiceLib.Services
} }
})); }));
} }
Task.WaitAll([.. tasks]); await Task.WhenAll(tasks);
await Task.CompletedTask;
} }
private async Task RunRealPingBatchAsync(List<ServerTestItem> lstSelected, string exitLoopKey, int pageSize = 0) private async Task RunRealPingBatchAsync(List<ServerTestItem> lstSelected, string exitLoopKey, int pageSize = 0)
@ -216,7 +215,7 @@ namespace ServiceLib.Services
await DoRealPing(downloadHandle, it); await DoRealPing(downloadHandle, it);
})); }));
} }
Task.WaitAll(tasks.ToArray()); await Task.WhenAll(tasks);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -291,7 +290,7 @@ namespace ServiceLib.Services
} }
})); }));
} }
Task.WaitAll(tasks.ToArray()); await Task.WhenAll(tasks);
} }
private async Task<int> DoRealPing(DownloadService downloadHandle, ServerTestItem it) private async Task<int> DoRealPing(DownloadService downloadHandle, ServerTestItem it)