fix: set timeout while init
This commit is contained in:
parent
45554c8856
commit
93b6d4d38c
@ -33,7 +33,7 @@ def send_ip():
|
|||||||
url = server_address + "/get_node?ip=" + ip
|
url = server_address + "/get_node?ip=" + ip
|
||||||
# ip = get_local_ip() # type: ignore
|
# ip = get_local_ip() # type: ignore
|
||||||
global id
|
global id
|
||||||
id = requests.get(url)
|
id = requests.get(url,timeout=3)
|
||||||
|
|
||||||
|
|
||||||
# 用环境变量获取本机ip
|
# 用环境变量获取本机ip
|
||||||
@ -50,7 +50,7 @@ def init():
|
|||||||
|
|
||||||
|
|
||||||
def clear():
|
def clear():
|
||||||
pass
|
print("exit node")
|
||||||
|
|
||||||
|
|
||||||
# 接收用户发来的消息,经过处理之后,再将消息发送给其他用户
|
# 接收用户发来的消息,经过处理之后,再将消息发送给其他用户
|
||||||
@ -63,7 +63,7 @@ async def send_heartbeat_internal() -> None:
|
|||||||
while True:
|
while True:
|
||||||
# print('successful send my_heart')
|
# print('successful send my_heart')
|
||||||
try:
|
try:
|
||||||
folderol = requests.get(url)
|
folderol = requests.get(url,timeout=3)
|
||||||
except:
|
except:
|
||||||
print("Central server error")
|
print("Central server error")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user