This commit is contained in:
2dust 2025-10-08 15:48:45 +08:00
parent 4eaf31bbf8
commit 929520775d
3 changed files with 11 additions and 17 deletions

View file

@ -64,7 +64,7 @@ public class SpeedtestService(Config config, Func<SpeedTestResult, Task> updateF
var lstSelected = new List<ServerTestItem>();
foreach (var it in selecteds)
{
if (it.ConfigType == EConfigType.Custom)
if (it.ConfigType is EConfigType.Custom or EConfigType.PolicyGroup or EConfigType.ProxyChain)
{
continue;
}
@ -116,10 +116,6 @@ public class SpeedtestService(Config config, Func<SpeedTestResult, Task> updateF
List<Task> tasks = [];
foreach (var it in selecteds)
{
if (it.ConfigType == EConfigType.Custom)
{
continue;
}
tasks.Add(Task.Run(async () =>
{
try
@ -199,10 +195,6 @@ public class SpeedtestService(Config config, Func<SpeedTestResult, Task> updateF
{
continue;
}
if (it.ConfigType == EConfigType.Custom)
{
continue;
}
tasks.Add(Task.Run(async () =>
{
await DoRealPing(it);
@ -215,9 +207,12 @@ public class SpeedtestService(Config config, Func<SpeedTestResult, Task> updateF
Logging.SaveLog(_tag, ex);
}
finally
{
if (processService != null)
{
await processService?.StopAsync();
}
}
return true;
}
@ -233,10 +228,6 @@ public class SpeedtestService(Config config, Func<SpeedTestResult, Task> updateF
await UpdateFunc(it.IndexId, "", ResUI.SpeedtestingSkip);
continue;
}
if (it.ConfigType == EConfigType.Custom)
{
continue;
}
await concurrencySemaphore.WaitAsync();
tasks.Add(Task.Run(async () =>
@ -271,8 +262,11 @@ public class SpeedtestService(Config config, Func<SpeedTestResult, Task> updateF
Logging.SaveLog(_tag, ex);
}
finally
{
if (processService != null)
{
await processService?.StopAsync();
}
concurrencySemaphore.Release();
}
}));

View file

@ -28,7 +28,7 @@ public partial class RoutingRuleDetailsWindow : WindowBase<RoutingRuleDetailsVie
clbProtocol.ItemsSource = Global.RuleProtocols;
clbInboundTag.ItemsSource = Global.InboundTags;
cmbNetwork.ItemsSource = Global.RuleNetworks;
cmbRuleType.ItemsSource = Utils.GetEnumNames<ERuleType>();
cmbRuleType.ItemsSource = Utils.GetEnumNames<ERuleType>().AppendEmpty();
if (!rulesItem.Id.IsNullOrEmpty())
{

View file

@ -21,7 +21,7 @@ public partial class RoutingRuleDetailsWindow
clbProtocol.ItemsSource = Global.RuleProtocols;
clbInboundTag.ItemsSource = Global.InboundTags;
cmbNetwork.ItemsSource = Global.RuleNetworks;
cmbRuleType.ItemsSource = Utils.GetEnumNames<ERuleType>();
cmbRuleType.ItemsSource = Utils.GetEnumNames<ERuleType>().AppendEmpty();
if (!rulesItem.Id.IsNullOrEmpty())
{