feat: 优化get_tyy_data 2
This commit is contained in:
parent
8efd28633c
commit
bfc37f69af
|
@ -176,7 +176,7 @@ def get_tyy_data(*args):
|
|||
sc_all.pop(f"{host}_{port}", None)
|
||||
sc = None
|
||||
raise ParseError(f"采集器连接失败-{str(e)}")
|
||||
except Exception as e:
|
||||
except TimeoutError as e:
|
||||
if sc:
|
||||
try:
|
||||
sc.close()
|
||||
|
@ -184,7 +184,7 @@ def get_tyy_data(*args):
|
|||
pass
|
||||
sc_all.pop(f"{host}_{port}", None)
|
||||
sc = None
|
||||
raise ParseError(f"采集器连接失败-{str(e)}")
|
||||
raise ParseError(f"采集器连接超时-{str(e)}")
|
||||
|
||||
connect_and_send()
|
||||
resp = sc.recv(1024)
|
||||
|
|
Loading…
Reference in New Issue