Skip to content

Commit ccfbf38

Browse files
authored
Bugfix: Check connection status before attempting to reconnect (#438)
1 parent 725fe31 commit ccfbf38

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/viam/robot/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ async def _check_connection(self, check_every: int, reconnect_every: int):
285285
if reconnect_every <= 0:
286286
continue
287287

288+
if self._connected:
289+
continue
290+
288291
reconnect_attempts = self._options.dial_options.max_reconnect_attempts if self._options.dial_options else 3
289292

290293
for _ in range(reconnect_attempts):

0 commit comments

Comments
 (0)