Skip to content

Commit

Permalink
Update pkg/app.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
freak12techno and coderabbitai[bot] authored Jun 28, 2024
1 parent 9f5189f commit 0aaff48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ func (a *App) Start() {

func (a *App) Stop() {
a.Logger.Info().Str("addr", a.Config.ListenAddress).Msg("Shutting down server...")
_ = a.Server.Shutdown(context.Background())
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
_ = a.Server.Shutdown(ctx)
}

func (a *App) Handler(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit 0aaff48

Please sign in to comment.