mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-09 22:15:00 +03:00
fix(speedtest): clear the last speed when a speed test starts (#10449)
A speed test only stored a speed above zero, so a node that was skipped because its delay test failed, or whose download failed, kept the speed of the previous run. The list showed the skip or error text until it was sorted or refreshed; then the old speed came back and the node sorted as if it had been measured. Clear the stored speed when a speed or mixed test starts.
This commit is contained in:
@@ -188,10 +188,13 @@ public class SpeedtestService(Config config, Func<SpeedTestResult, Task> updateF
|
||||
break;
|
||||
|
||||
case ESpeedActionType.Speedtest:
|
||||
// A skipped or failed test must not leave the last speed behind for sorting.
|
||||
ProfileExManager.Instance.SetTestSpeed(it.IndexId, 0);
|
||||
await UpdateFunc(it.IndexId, "", message);
|
||||
break;
|
||||
|
||||
case ESpeedActionType.Mixedtest:
|
||||
ProfileExManager.Instance.SetTestSpeed(it.IndexId, 0);
|
||||
await UpdateFunc(it.IndexId, message, message);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user