Live: fix closing ws conns for push endpoints (#42447)

This commit is contained in:
Alexander Emelin 2021-11-29 19:22:42 +03:00 committed by GitHub
parent 98dcac7596
commit 7034173ef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -55,11 +55,13 @@ func (s *PipelinePushHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
if err != nil {
return
}
defer func() { _ = conn.Close() }()
setupWSConn(r.Context(), conn, s.config)
for {
_, body, err := conn.ReadMessage()
if err != nil {
logger.Debug("Error reading websocket connection", "error", err)
break
}

View File

@ -57,11 +57,13 @@ func (s *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
if err != nil {
return
}
defer func() { _ = conn.Close() }()
setupWSConn(r.Context(), conn, s.config)
for {
_, body, err := conn.ReadMessage()
if err != nil {
logger.Debug("Error reading websocket connection", "error", err)
break
}