The library seems to panic on occasion in:
func (w *WebsocketClient) disconnectAndRetry() {
w.log.Warn("disconnected")
w.heartbeat.Stop()
w.conMutex.Lock()
w.connected = false
w.conMutex.Unlock()
w.log.Info("retrying websocket connection in 30s")
time.Sleep(30 * time.Second)
w.Restart()
}
at the line w.heartbeat.Stop(). Seems like w.heartbeat can be nil at times.
Patching so that it reads:
if w.heartbeat != nil {
w.heartbeat.Stop()
}
fixes the panic however w.heartbeat being nil at that time likely points to some other race condition.
The library seems to panic on occasion in:
at the line
w.heartbeat.Stop(). Seems likew.heartbeatcan benilat times.Patching so that it reads:
fixes the panic however
w.heartbeatbeingnilat that time likely points to some other race condition.