sent err to channel
This commit is contained in:
parent
ea8c9dd22e
commit
1432587369
7
http.go
7
http.go
@ -533,9 +533,12 @@ func (h *Server) Start() error {
|
|||||||
ctx, cancel := context.WithTimeout(context.Background(), h.opts.GracefulTimeout)
|
ctx, cancel := context.WithTimeout(context.Background(), h.opts.GracefulTimeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
if err := hs.Shutdown(ctx); err != nil {
|
err := hs.Shutdown(ctx)
|
||||||
ch <- hs.Close()
|
if err != nil {
|
||||||
|
err = hs.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ch <- err
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user