Skip to content

Commit

Permalink
test calling composedHandler.ServeHTTP directly
Browse files Browse the repository at this point in the history
  • Loading branch information
nader-ziada committed Oct 22, 2021
1 parent bbf9bb9 commit 681b95f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions cmd/queue/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,6 @@ func buildProbe(logger *zap.SugaredLogger, encodedProbe string, autodetectHTTP2
return readiness.NewProbe(coreProbe)
}

func healthCheckForDrainer(h http.Handler) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
h.ServeHTTP(w, r)
}
}

func buildServer(ctx context.Context, env config, drainer *pkghandler.Drainer, probeContainer func() bool, stats *network.RequestStats,
logger *zap.SugaredLogger) *http.Server {

Expand Down Expand Up @@ -320,7 +314,7 @@ func buildServer(ctx context.Context, env config, drainer *pkghandler.Drainer, p
}

drainer.Inner = composedHandler
drainer.HealthCheck = healthCheckForDrainer(composedHandler)
drainer.HealthCheck = composedHandler.ServeHTTP

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

0 comments on commit 681b95f

Please sign in to comment.