frappy_psi.sea: try to reconnect on failure

both .asynio and .syncio connection should be tried to reopen.
(fix from mlz gerrit)

Change-Id: I0da5bd9927865a1c55afb93a7a5b76c44fc8750e
This commit is contained in:
zolliker 2023-06-29 11:27:28 +02:00
parent d7a1604bd5
commit a8e1d0e1e8

View File

@ -227,6 +227,10 @@ class SeaClient(ProxyClient, Module):
else: else:
result.append(reply) result.append(reply)
except ConnectionClosed: except ConnectionClosed:
try:
self.syncio.disconnect()
except Exception:
pass
self.syncio = None self.syncio = None
raise TimeoutError('no response within 10s') raise TimeoutError('no response within 10s')
@ -238,9 +242,10 @@ class SeaClient(ProxyClient, Module):
continue continue
except ConnectionClosed: except ConnectionClosed:
try: try:
self.asynio.close() self.asynio.disconnect()
except Exception: except Exception:
self.asynio = None pass
self.asynio = None
break break
try: try:
msg = json.loads(reply) msg = json.loads(reply)