From cdbc1771792e8555d2c269e26507c73c9954cbef Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Tue, 30 Aug 2022 11:46:45 +0200 Subject: [PATCH] Schedule reconnect asynchronously if ping could not be sent. --- mcu_proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcu_proxy.go b/mcu_proxy.go index 99f0010..388a47a 100644 --- a/mcu_proxy.go +++ b/mcu_proxy.go @@ -488,7 +488,7 @@ func (c *mcuProxyConnection) sendPing() bool { c.conn.SetWriteDeadline(now.Add(writeWait)) // nolint if err := c.conn.WriteMessage(websocket.PingMessage, []byte(msg)); err != nil { log.Printf("Could not send ping to proxy at %s: %v", c, err) - c.scheduleReconnect() + go c.scheduleReconnect() return false }