mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Server: Defer wg.Done call to ensure it's called (#20700)
This commit is contained in:
parent
1751770394
commit
3c7cfbebe8
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user