Update SpeedtestService.cs

AI-optimized code
This commit is contained in:
2dust 2025-03-06 14:08:29 +08:00
parent 7e8b405555
commit c374b8565b

View file

@ -141,8 +141,7 @@ namespace ServiceLib.Services
}
}));
}
Task.WaitAll([.. tasks]);
await Task.CompletedTask;
await Task.WhenAll(tasks);
}
private async Task RunRealPingBatchAsync(List<ServerTestItem> 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<int> DoRealPing(DownloadService downloadHandle, ServerTestItem it)