Compare commits

..

1 Commits

Author SHA1 Message Date
b296d73367 fix: discard reconnect channel to prevent memory leak 2026-02-08 11:46:26 +07:00

View File

@@ -294,6 +294,11 @@ func (wsClient *SafeWebsocketClient) reconnectHandler() {
default: // prevent blocking if chan is full
}
}
if len(wsClient.reconnectChans) > 1 {
wsClient.reconnectChans = wsClient.reconnectChans[1:]
} else {
wsClient.reconnectChans = nil
}
}
case <-wsClient.ctx.Done():
log.Println("reconnect handler stopped due to client shutdown")