Simplify stop signal handling

This commit is contained in:
ErickSkrauch
2024-02-07 18:33:06 +01:00
parent cecd07c113
commit fdafbc4f0e
3 changed files with 17 additions and 61 deletions

View File

@@ -39,11 +39,7 @@ func newHandlerFactory(
}
router.StrictSlash(true)
requestEventsMiddleware := CreateRequestEventsMiddleware()
router.Use(requestEventsMiddleware)
// NotFoundHandler doesn't call for registered middlewares, so we must wrap it manually.
// See https://github.com/gorilla/mux/issues/416#issuecomment-600079279
router.NotFoundHandler = requestEventsMiddleware(http.HandlerFunc(NotFoundHandler))
router.NotFoundHandler = http.HandlerFunc(NotFoundHandler)
if slices.Contains(enabledModules, "api") {
var apiRouter *mux.Router