Improve:return 0 instead of Int.max when speedtest fail during jsbridge api
This commit is contained in:
parent
8a65481831
commit
cc9d3f23f2
@ -99,7 +99,14 @@ class JsBridgeUtil {
|
||||
bridge.registerHandler("speedTest") { (anydata, responseCallback) in
|
||||
if let proxyName = anydata as? String {
|
||||
ApiRequest.getProxyDelay(proxyName: proxyName) { (delay) in
|
||||
SpeedDataRecorder.shared.speedDict[proxyName] = delay
|
||||
var resp:Int
|
||||
if delay == Int.max {
|
||||
resp = 0
|
||||
} else {
|
||||
resp = delay
|
||||
}
|
||||
|
||||
SpeedDataRecorder.shared.speedDict[proxyName] = resp
|
||||
responseCallback?(delay)
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user