moninj: remove CancelledError workaround

pull/2365/head
Simon Renblad 2024-03-06 16:32:22 +08:00 committed by Sébastien Bourdeauducq
parent e56331248e
commit 27178c1478
2 changed files with 2 additions and 7 deletions

View File

@ -94,9 +94,7 @@ class CommMonInj:
self.injection_status_cb(channel, override, value)
else:
raise ValueError("Unknown packet type", ty)
except asyncio.CancelledError:
raise
except:
except Exception:
logger.error("Moninj connection terminating with exception", exc_info=True)
finally:
if self.disconnect_cb is not None:

View File

@ -719,10 +719,7 @@ class _DeviceManager:
self.disconnect_cb)
try:
await new_mi_connection.connect(self.mi_addr, self.mi_port)
except asyncio.CancelledError:
logger.info("cancelled connection to moninj")
break
except:
except Exception:
logger.error("failed to connect to moninj. Is aqctl_moninj_proxy running?", exc_info=True)
await asyncio.sleep(10.)
self.reconnect_mi.set()