From 3e4533f737d98cb5acecc60e4f04ad16650c945c Mon Sep 17 00:00:00 2001 From: nyaasuki Date: Mon, 8 Jan 2024 17:29:28 +0800 Subject: [PATCH] bug fix --- main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index f8d8a83..0efd296 100644 --- a/main.py +++ b/main.py @@ -44,18 +44,24 @@ def main(): i = 0 j = 0 while(1): - ascii_tag() if not network_test(): #网络异常 i +=1 #异常计数 3次失败重启 + ascii_tag() time.sleep(3) else: #网络正常 i = 0 + ascii_tag() time.sleep(10) - if (i > 2): #异常3次 + if (i > 2): #异常3次 if not network_restart(): #接口重启失败 + ascii_tag() + print("接口错误,输入回车后退出。") input() + exit() else: #接口重启完成 i = 0 + j += 1 + ascii_tag() time.sleep(10) if __name__ == "__main__":