Skip to content

Commit

Permalink
ci: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed May 30, 2022
1 parent e10850b commit 0a4a478
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,11 @@ func (c *Client) Restart() error {

// Stop stops a Client.
func (c *Client) Stop() {
c.Handler.AsyncExecute(func() {
c.mux.Lock()
c.running = false
c.mux.Unlock()
c.mux.Lock()
c.running = false
c.mux.Unlock()

c.Conn.Close()
})
c.Conn.Close()
}

func (c *Client) closeAndClean() {
Expand Down
2 changes: 1 addition & 1 deletion handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ func (h *handler) OnMessage(c *Client, msg *Message) {
}
default:
log.Warn("%v OnMessage: invalid cmd [%v]", h.LogTag(), msg.Cmd())
c.Stop()
go c.Stop()
}
}

Expand Down

0 comments on commit 0a4a478

Please sign in to comment.