mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-10-25 00:56:14 +08:00
debug
This commit is contained in:
+1
-3
@@ -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'):
|
||||
|
||||
Reference in New Issue
Block a user