U 优化站点检测异常信息输出

pull/418/head
vapao 2021-12-06 16:19:39 +08:00
parent 121c605332
commit 8966567024
1 changed files with 2 additions and 2 deletions

View File

@ -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)