Skip to content

Commit

Permalink
use different handler for healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
nader-ziada committed Oct 27, 2021
1 parent be57d2d commit b1b343a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/queue/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,14 @@ func buildServer(ctx context.Context, env config, drainer *pkghandler.Drainer, p
composedHandler = requestLogHandler(logger, composedHandler, env)
}

var healthcheckHandler http.Handler
healthcheckHandler = health.ProbeHandler(probeContainer, tracingEnabled, healthcheckHandler)
if env.ServingEnableRequestLog {
healthcheckHandler = requestLogHandler(logger, healthcheckHandler, env)
}

drainer.Inner = composedHandler
drainer.HealthCheck = composedHandler.ServeHTTP
drainer.HealthCheck = healthcheckHandler.ServeHTTP

return pkgnet.NewServer(":"+env.QueueServingPort, drainer)
}
Expand Down

0 comments on commit b1b343a

Please sign in to comment.