refactor: shut down more quickly
3 files changed, 4 insertions(+), 4 deletions(-)
M cmd/searchix-web/main.go → cmd/searchix-web/main.go
@@ -161,8 +161,6 @@ imp.StartUpdateTimer(ctx, sentry.CurrentHub().Clone()) }() <-ctx.Done() - logger.Debug("calling stop") s.Stop() wg.Wait() - logger.Debug("done") }
M internal/server/server.go → internal/server/server.go
@@ -90,7 +90,7 @@ s.log.Debug("stop called") idleConnsClosed := make(chan struct{}) if s.cfg.Web.Environment == "development" { - shutdownTimeout = 1 * time.Second + shutdownTimeout = 1 * time.Millisecond } go func() {
M web/searchix.go → web/searchix.go
@@ -56,5 +56,7 @@ } func (s *Server) Stop() { <-s.sv.Stop() - s.sentryHub.Flush(2 * time.Second) + if s.cfg.Web.Environment == "production" { + s.sentryHub.Flush(2 * time.Second) + } }