all repos — searchix @ 90f16010ba6c54f9e215ed48873686a428bcb746

Search engine for NixOS, nix-darwin, home-manager and NUR users

refactor: shut down more quickly

Alan Pearce
commit

90f16010ba6c54f9e215ed48873686a428bcb746

parent

1db432a56d503d60ccfafadfe6494f64cb8c325c

3 files changed, 4 insertions(+), 4 deletions(-)

changed files
M cmd/searchix-web/main.gocmd/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.gointernal/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.goweb/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) + } }