From 332c9c0fcdb91716288052e696fde3ef45916acd Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Thu, 7 Mar 2024 10:40:44 +0800 Subject: [PATCH] waveform: consistent log messages --- artiq/dashboard/waveform.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/artiq/dashboard/waveform.py b/artiq/dashboard/waveform.py index a0eda50a3..5153dd807 100644 --- a/artiq/dashboard/waveform.py +++ b/artiq/dashboard/waveform.py @@ -45,7 +45,7 @@ class ProxyClient(): self.addr = addr self.port = port self.port_proxy = port_proxy - self.reconnect() + self._reconnect_event.set() async def trigger_proxy_task(self): remote = AsyncioClient() @@ -72,12 +72,12 @@ class ProxyClient(): await self.receiver.close() self.receiver = None new_receiver = comm_analyzer.AnalyzerProxyReceiver( - self.receive_cb, self.reconnect) + self.receive_cb, self.disconnect_cb) try: if self.addr is not None: await asyncio.wait_for(new_receiver.connect(self.addr, self.port_proxy), self.timeout) - logger.info("connected to analyzer proxy %s:%d", self.addr, self.port_proxy) + logger.info("ARTIQ dashboard connected to analyzer proxy (%s)", self.addr) self.timer_cur = self.timer self.receiver = new_receiver continue @@ -100,7 +100,8 @@ class ProxyClient(): if self.receiver is not None: await self.receiver.close() - def reconnect(self): + def disconnect_cb(self): + logger.error("lost connection to analyzer proxy") self._reconnect_event.set()