Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
already canceled context should not be used for shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
sio4 committed Mar 5, 2022
1 parent 3fbd918 commit 002824e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ func (a *App) Serve(srvs ...servers.Server) error {
}

a.Logger.Info("Shutting down servers")
graceful := context.Background()
for _, s := range srvs {
if err := s.Shutdown(ctx); err != nil {
a.Logger.Warn("shutting down server: ", err)
if err := s.Shutdown(graceful); err != nil {
a.Logger.Error("shutting down server: ", err)
}
}

Expand Down

0 comments on commit 002824e

Please sign in to comment.