Fixed leaking Subscriber(s) on unexpected closure from clients
This commit is contained in:
джерело
760e61ca91
коміт
fba29f436b
|
@ -519,6 +519,7 @@ func (c *Client) readPump() {
|
|||
if err != nil {
|
||||
if websocket.IsUnexpectedCloseError(err, websocket.CloseNormalClosure) {
|
||||
log.Errorf("unexpected close error from %s: %v", c.id, err)
|
||||
c.bus.Unsubscribe(c.id, c.topic.Name)
|
||||
}
|
||||
break
|
||||
}
|
||||
|
|
Завантаження…
Посилання в новій задачі