Shut down the app when the listener fails (closes #200) (#218)
All checks were successful
check / check (push) Successful in 3m48s

This commit was merged in pull request #218.
This commit is contained in:
2026-08-20 06:42:36 +02:00
parent bb30b3ad64
commit a13e5b7ded
3 changed files with 134 additions and 10 deletions

View File

@@ -43,10 +43,7 @@ func (s *Server) serveUntilShutdown() {
err := s.httpServer.ListenAndServe()
if err != nil && !errors.Is(err, http.ErrServerClosed) {
s.log.Error("listen error", "error", err)
if s.cancelFunc != nil {
s.cancelFunc()
}
s.shutdownOnListenFailure()
}
}