Close SSE connection on write error
This commit is contained in:
parent
458017b112
commit
d6dd0aaae7
1 changed files with 2 additions and 1 deletions
|
|
@ -158,7 +158,8 @@ func (b *broker) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
log.Trace(ctx, "Sending event to client", "event", *event, "client", c.String())
|
log.Trace(ctx, "Sending event to client", "event", *event, "client", c.String())
|
||||||
err := writeEvent(ctx, w, *event, writeTimeOut)
|
err := writeEvent(ctx, w, *event, writeTimeOut)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debug(ctx, "Error sending event to client", "event", *event, "client", c.String(), err)
|
log.Debug(ctx, "Error sending event to client. Closing connection", "event", *event, "client", c.String(), err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue