diff --git a/cmd/ketchup/api.go b/cmd/ketchup/api.go index 5d956c61..9201b39a 100644 --- a/cmd/ketchup/api.go +++ b/cmd/ketchup/api.go @@ -158,15 +158,17 @@ func main() { publicHandler.ServeHTTP(w, r) }) - doneCtx := healthApp.ContextDone() + doneCtx := healthApp.Done(ctx) go githubApp.Start(doneCtx) if schedulerApp != nil { go schedulerApp.Start(doneCtx) } - go promServer.Start(healthApp.ContextEnd(), "prometheus", prometheusApp.Handler()) - go appServer.Start(healthApp.ContextEnd(), "http", httputils.Handler(appHandler, healthApp, recoverer.Middleware, prometheusApp.Middleware, tracerApp.Middleware, owasp.New(owaspConfig).Middleware, cors.New(corsConfig).Middleware)) + endCtx := healthApp.End(ctx) + + go promServer.Start(endCtx, "prometheus", prometheusApp.Handler()) + go appServer.Start(endCtx, "http", httputils.Handler(appHandler, healthApp, recoverer.Middleware, prometheusApp.Middleware, tracerApp.Middleware, owasp.New(owaspConfig).Middleware, cors.New(corsConfig).Middleware)) healthApp.WaitForTermination(appServer.Done()) server.GracefulWait(appServer.Done(), promServer.Done()) diff --git a/go.mod b/go.mod index 9f74d4fe..7d331b39 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/ViBiOh/auth/v2 v2.14.20 github.com/ViBiOh/flags v1.2.0 - github.com/ViBiOh/httputils/v4 v4.52.0 + github.com/ViBiOh/httputils/v4 v4.52.1 github.com/ViBiOh/mailer v1.30.18 github.com/golang/mock v1.6.0 github.com/jackc/pgconn v1.13.0 diff --git a/go.sum b/go.sum index 38a132bb..dd3cab18 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,8 @@ github.com/ViBiOh/auth/v2 v2.14.20 h1:xCTQrnTOFLiyFLIV0CMXlCPrHEbimganZsbTbdHUh5 github.com/ViBiOh/auth/v2 v2.14.20/go.mod h1:lL4rXpvS0Gtui4CSy0J/AK1pq59XVXaR4Qz1ELsQ3eY= github.com/ViBiOh/flags v1.2.0 h1:DaujjNXzD29KxKyp4eZdn7c9+uBN5DokWgDAe7DcUmc= github.com/ViBiOh/flags v1.2.0/go.mod h1:UyMB5zeD/aId7Xw3x7577ZNU298JmukzOcV8p/H2W1s= -github.com/ViBiOh/httputils/v4 v4.52.0 h1:e6LQNhjp8e3gsqTqPruux6UiZDI3Wej/hyWc0IVq9nQ= -github.com/ViBiOh/httputils/v4 v4.52.0/go.mod h1:YA+JJC5yrILqjk+OI9L0emleE2rXD3Q/z6gcS22IZlE= +github.com/ViBiOh/httputils/v4 v4.52.1 h1:0hfZXlwLhTDPRFvcryvrNe6ZUaYnQfrFdB0tnrrf1Vg= +github.com/ViBiOh/httputils/v4 v4.52.1/go.mod h1:YA+JJC5yrILqjk+OI9L0emleE2rXD3Q/z6gcS22IZlE= github.com/ViBiOh/mailer v1.30.18 h1:56WqAM8RewgkCXYP+jtBnQKjdTobnkappxU7gIErV0E= github.com/ViBiOh/mailer v1.30.18/go.mod h1:F4YM+ANIsVzXcYqjA3I6JfJCJqC9QB+jirML+XPg4RY= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=