WebSocketHandler no return.

This commit is contained in:
Miroslav Šedivý 2020-10-28 20:29:18 +01:00
parent 26c2bbf10d
commit 01d125316f
2 changed files with 2 additions and 4 deletions

View File

@ -9,7 +9,7 @@ type WebSocket interface {
} }
type WebSocketHandler interface { type WebSocketHandler interface {
Start() error Start()
Shutdown() error Shutdown() error
Upgrade(w http.ResponseWriter, r *http.Request) error Upgrade(w http.ResponseWriter, r *http.Request) error
} }

View File

@ -54,7 +54,7 @@ type WebSocketHandler struct {
shutdown chan bool shutdown chan bool
} }
func (ws *WebSocketHandler) Start() error { func (ws *WebSocketHandler) Start() {
ws.sessions.OnCreated(func(id string, session types.Session) { ws.sessions.OnCreated(func(id string, session types.Session) {
if err := ws.handler.SessionCreated(id, session); err != nil { if err := ws.handler.SessionCreated(id, session); err != nil {
ws.logger.Warn().Str("id", id).Err(err).Msg("session created with and error") ws.logger.Warn().Str("id", id).Err(err).Msg("session created with and error")
@ -108,8 +108,6 @@ func (ws *WebSocketHandler) Start() error {
} }
} }
}() }()
return nil
} }
func (ws *WebSocketHandler) Shutdown() error { func (ws *WebSocketHandler) Shutdown() error {