Commit 3c7cfbeb by Arve Knudsen Committed by GitHub

Server: Defer wg.Done call to ensure it's called (#20700)

parent 17517703
......@@ -135,11 +135,12 @@ func (hs *HTTPServer) Run(ctx context.Context) error {
// handle http shutdown on server context done
go func() {
defer wg.Done()
<-ctx.Done()
if err := hs.httpSrv.Shutdown(context.Background()); err != nil {
hs.log.Error("Failed to shutdown server", "error", err)
}
wg.Done()
}()
switch setting.Protocol {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment