fix: set latency for test failed (#948)

This commit is contained in:
YetAnotherZephyruso 2024-08-26 16:24:40 +08:00 committed by GitHub
parent 9a9c5ae35d
commit 9189bf5efb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -184,6 +184,7 @@ export const useProxies = () => {
setProxyLatencyTestingMap(nodeName, async () => {
await proxyIPv6SupportTest(nodeName, provider)
try {
const { delay } = await proxyLatencyTestAPI(
nodeName,
provider,
@ -195,6 +196,12 @@ export const useProxies = () => {
...latencyMap,
[nodeName]: delay,
}))
} catch {
setLatencyMap((latencyMap) => ({
...latencyMap,
[nodeName]: latencyQualityMap().NOT_CONNECTED,
}))
}
})
}