Context: Add context to /api/health calls (#40031)

Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Carl Bergquist
2021-10-11 14:35:03 +02:00
committed by GitHub
parent 57fcfd578d
commit c9f25cf0a5
5 changed files with 22 additions and 13 deletions
+1 -1
View File
@@ -493,7 +493,7 @@ func (hs *HTTPServer) apiHealthHandler(ctx *web.Context) {
data.Set("commit", hs.Cfg.BuildCommit)
}
if !hs.databaseHealthy() {
if !hs.databaseHealthy(ctx.Req.Context()) {
data.Set("database", "failing")
ctx.Resp.Header().Set("Content-Type", "application/json; charset=UTF-8")
ctx.Resp.WriteHeader(503)