Skip to content

Commit

Permalink
fix(api): remove client when close message was send (#5227)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguiheux authored Jun 3, 2020
1 parent 00d584c commit dc2af41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions engine/api/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ func (c *websocketClient) send(ctx context.Context, event sdk.Event) (err error)
Event: event,
}
if err := c.con.WriteJSON(msg); err != nil {
// ErrCloseSent is returned when the application writes a message to the connection after sending a close message.
if err == websocket.ErrCloseSent {
return sdk.WithStack(err)
}
if strings.Contains(err.Error(), "use of closed network connection") {
return sdk.WithStack(err)
}
Expand Down

0 comments on commit dc2af41

Please sign in to comment.