From 3641c7a05aa13399aebdbf4da139214f999bb6b7 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sat, 19 Feb 2022 14:23:23 +0800 Subject: [PATCH] fix: no integer when http check not health --- ProxyChecker/Http.py | 2 +- Run.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ProxyChecker/Http.py b/ProxyChecker/Http.py index b8c1243..da60bab 100644 --- a/ProxyChecker/Http.py +++ b/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]) # 返回最低延迟 diff --git a/Run.py b/Run.py index 1720d6b..d723b45 100644 --- a/Run.py +++ b/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