sent err to channel

This commit is contained in:
Денис Евстигнеев 2024-03-08 18:00:02 +03:00
parent ea8c9dd22e
commit 1432587369

View File

@ -533,9 +533,12 @@ func (h *Server) Start() error {
ctx, cancel := context.WithTimeout(context.Background(), h.opts.GracefulTimeout)
defer cancel()
if err := hs.Shutdown(ctx); err != nil {
ch <- hs.Close()
err := hs.Shutdown(ctx)
if err != nil {
err = hs.Close()
}
ch <- err
}()
return nil