Optimize download and speedtest (#10147)

* Optimize RunMixedTestAsync

* Use stopCts instead of exitLoopKey

* Refactor
This commit is contained in:
DHR60
2026-09-19 02:41:40 +00:00
committed by GitHub
parent cef40d38ee
commit 21bafe52e0
11 changed files with 520 additions and 374 deletions
+4 -4
View File
@@ -1018,12 +1018,12 @@ public class Utils
return new Dictionary<string, string>();
}
public static async Task<string?> GetCliWrapOutput(string filePath, string? arg)
public static async Task<string?> GetCliWrapOutput(string filePath, string? arg, CancellationToken cancellationToken = default)
{
return await GetCliWrapOutput(filePath, arg != null ? new List<string>() { arg } : null);
return await GetCliWrapOutput(filePath, arg != null ? new List<string>() { arg } : null, cancellationToken);
}
public static async Task<string?> GetCliWrapOutput(string filePath, IEnumerable<string>? args)
public static async Task<string?> GetCliWrapOutput(string filePath, IEnumerable<string>? args, CancellationToken cancellationToken = default)
{
try
{
@@ -1040,7 +1040,7 @@ public class Utils
}
}
var result = await cmd.ExecuteBufferedAsync();
var result = await cmd.ExecuteBufferedAsync(cancellationToken);
if (result.IsSuccess)
{
return result.StandardOutput ?? "";