mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
websocket shutdown + log.
This commit is contained in:
parent
137614c087
commit
fd9d5ec6f8
@ -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user