From 21b77567f255dbbcaf86e5f19feb5eeca0c078bc Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Wed, 14 Feb 2024 17:12:27 +0800 Subject: [PATCH] waveform: add timeout to reconnect_cr --- artiq/dashboard/waveform.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/artiq/dashboard/waveform.py b/artiq/dashboard/waveform.py index f03a12e05..97d07576e 100644 --- a/artiq/dashboard/waveform.py +++ b/artiq/dashboard/waveform.py @@ -50,7 +50,9 @@ class _BaseProxyClient: await self._reconnect_event.wait() self._reconnect_event.clear() try: - await self.reconnect_cr() + await asyncio.wait_for(self.reconnect_cr(), timeout=5) + except asyncio.CancelledError: + raise except: await asyncio.sleep(5) self._reconnect_event.set()