This commit is contained in:
JrD
2020-09-18 12:20:59 +08:00
parent d39423ef6a
commit b12691e86a
+1 -3
View File
@@ -743,10 +743,8 @@ def ping_avg_time(nameserver):
temp_path = settings.temp_save_dir.joinpath('ping')
ping(nameserver, path=temp_path)
with open(temp_path, 'r') as f:
print(platform.system())
text = f.read()
print(text)
if '100.0% packet loss' in text or '100% 丢失' in text:
if '100.0% packet loss' in text or '100% packet loss' in text or '100% 丢失' in text:
logger.log('ALERT', f'100.0% packet loss, ping {nameserver} failed.')
return None
elif platform.system() in ('Darwin', 'Linux'):