web:Fix a potential goroutine leak by channel (#8965)

Signed-off-by: lzhfromustc <lzhfromustc@gmail.com>
This commit is contained in:
lzhfromustc 2021-11-23 00:58:17 -08:00 committed by GitHub
parent f08c89e569
commit 5538c64e8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -594,7 +594,7 @@ func (h *Handler) Run(ctx context.Context, listener net.Listener, webConfig stri
ReadTimeout: h.options.ReadTimeout,
}
errCh := make(chan error)
errCh := make(chan error, 1)
go func() {
errCh <- toolkit_web.Serve(listener, httpSrv, webConfig, h.logger)
}()