Browse Source

fix: no integer when http check not health

master
Dnomd343 3 years ago
parent
commit
3641c7a05a
  1. 2
      ProxyChecker/Http.py
  2. 2
      Run.py

2
ProxyChecker/Http.py

@ -79,6 +79,6 @@ def httpCheck(port, url = 'http://gstatic.com/generate_204', timeout = 30):
for ret in result:
if ret > 0:
sum += ret
return False, sum / 2 # 返回成功延迟均值
return False, round(sum / 2, 2) # 返回成功延迟均值
else: # 全部成功
return True, min(min(result[0], result[1]), result[2]) # 返回最低延迟

2
Run.py

@ -72,11 +72,11 @@ def main(startDelay, httpCheckUrl, httpCheckTimeout):
elif checkResult['success'] == False:
print("error proxy info")
return
print(checkTag + ' -> ', end = '')
print(checkResult)
if __setCheckResult(checkTag, checkResult, redisObject, redisPrefix) == False:
print("redis write error")
return
print("ok")
defaultStartDelay = 1.5
defaultHttpCheckTimeout = 20

Loading…
Cancel
Save