зеркало из https://github.com/golang/build.git
cmd/coordinator: use Request.Context in handleLogs
CloseNotify has been deprecated in favor of Request.Context. Start using the newer API to avoid the panic when CloseNotify gets called too late. Fixes golang/go#44244. Change-Id: I1f01c2d42cf6735d1161b977b62a7d982e8a61ea Reviewed-on: https://go-review.googlesource.com/c/build/+/291769 Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org>
This commit is contained in:
Родитель
d576fd36a7
Коммит
dc2c694133
|
@ -810,7 +810,7 @@ func handleLogs(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
output := st.output.Reader()
|
||||
go func() {
|
||||
<-w.(http.CloseNotifier).CloseNotify()
|
||||
<-r.Context().Done()
|
||||
output.Close()
|
||||
}()
|
||||
buf := make([]byte, 65536)
|
||||
|
|
Загрузка…
Ссылка в новой задаче