feat: 优化get_tyy_data 2

This commit is contained in:
caoqianming 2025-06-10 13:35:38 +08:00
parent 8efd28633c
commit bfc37f69af
1 changed files with 2 additions and 2 deletions

View File

@ -176,7 +176,7 @@ def get_tyy_data(*args):
sc_all.pop(f"{host}_{port}", None) sc_all.pop(f"{host}_{port}", None)
sc = None sc = None
raise ParseError(f"采集器连接失败-{str(e)}") raise ParseError(f"采集器连接失败-{str(e)}")
except Exception as e: except TimeoutError as e:
if sc: if sc:
try: try:
sc.close() sc.close()
@ -184,7 +184,7 @@ def get_tyy_data(*args):
pass pass
sc_all.pop(f"{host}_{port}", None) sc_all.pop(f"{host}_{port}", None)
sc = None sc = None
raise ParseError(f"采集器连接失败-{str(e)}") raise ParseError(f"采集器连接超时-{str(e)}")
connect_and_send() connect_and_send()
resp = sc.recv(1024) resp = sc.recv(1024)