websocket shutdown + log.

This commit is contained in:
Miroslav Šedivý 2021-09-18 13:41:20 +02:00
parent 137614c087
commit fd9d5ec6f8

View File

@ -276,8 +276,8 @@ func (manager *WebSocketManagerCtx) handle(connection *websocket.Conn, session t
case <-cancel: case <-cancel:
return return
case <-manager.shutdown: case <-manager.shutdown:
connection.Close() err := connection.Close()
return manager.logger.Err(err).Msg("connection shutdown")
case <-ticker.C: case <-ticker.C:
if err := connection.WriteMessage(websocket.PingMessage, nil); err != nil { if err := connection.WriteMessage(websocket.PingMessage, nil); err != nil {
logger.Err(err).Msg("ping message has failed") logger.Err(err).Msg("ping message has failed")