mirror of https://github.com/openspug/spug
U 优化站点检测异常信息输出
parent
121c605332
commit
8966567024
|
@ -24,8 +24,8 @@ def site_check(url, limit):
|
||||||
if limit:
|
if limit:
|
||||||
duration = int(res.elapsed.total_seconds() * 1000)
|
duration = int(res.elapsed.total_seconds() * 1000)
|
||||||
if duration > int(limit):
|
if duration > int(limit):
|
||||||
return False, f'响应时间:{duration}ms'
|
return False, f'响应时间 {duration}ms 大于 {limit}ms'
|
||||||
return 200 <= res.status_code < 400, f'返回状态码:{res.status_code}'
|
return 200 <= res.status_code < 400, f'返回HTTP状态码 {res.status_code}'
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error = e.__str__()
|
error = e.__str__()
|
||||||
exps = re.findall(regex, error)
|
exps = re.findall(regex, error)
|
||||||
|
|
Loading…
Reference in New Issue