diff --git a/v2rayN/ServiceLib/Services/SpeedtestService.cs b/v2rayN/ServiceLib/Services/SpeedtestService.cs index f4cd64a2..998cedcc 100644 --- a/v2rayN/ServiceLib/Services/SpeedtestService.cs +++ b/v2rayN/ServiceLib/Services/SpeedtestService.cs @@ -196,6 +196,7 @@ public class SpeedtestService { return false; } + await Task.Delay(1000); var downloadHandle = new DownloadService(); @@ -255,9 +256,13 @@ public class SpeedtestService try { pid = await CoreHandler.Instance.LoadCoreConfigSpeedtest(it); - if (pid > 0) + if (pid < 0) { - await Task.Delay(500); + UpdateFunc(it.IndexId, "", ResUI.FailedToRunCore); + } + else + { + await Task.Delay(1000); var delay = await DoRealPing(downloadHandle, it); if (blSpeedTest) { @@ -271,10 +276,6 @@ public class SpeedtestService } } } - else - { - UpdateFunc(it.IndexId, "", ResUI.FailedToRunCore); - } } catch (Exception ex) { diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index 5edab5d4..7bae19be 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -552,6 +552,7 @@ public class MainWindowViewModel : MyReactiveObject { await LoadCore(); await SysProxyHandler.UpdateSysProxy(_config, false); + await Task.Delay(1000); }); Locator.Current.GetService()?.TestServerAvailability();