Skip to content

Commit

Permalink
Move sleep after close connection
Browse files Browse the repository at this point in the history
  • Loading branch information
helder-junior committed Nov 25, 2024
1 parent 7f23184 commit b64863c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ func (a *App) Run() {
}()

defer func() {
gracefullShutdowDuration := a.config.GetDuration("server.maxConnectionAge") + a.config.GetDuration("server.maxConnectionAgeGrace")
a.log.Infof("Waiting %s for graceful stop...", gracefullShutdowDuration)
time.Sleep(gracefullShutdowDuration)
gracefulShutdowDuration := a.config.GetDuration("server.maxConnectionAge") + a.config.GetDuration("server.maxConnectionAgeGrace")
a.log.Infof("Waiting %s for graceful stop...", gracefulShutdowDuration)
a.grpcServer.GracefulStop()
time.Sleep(gracefulShutdowDuration)
a.log.Info("Finished GRPC graceful stop...")
}()
select {
Expand Down

0 comments on commit b64863c

Please sign in to comment.