feat: format healthcheck responses (#7723)

This commit is contained in:
Colin Adler
2023-05-30 16:59:39 -05:00
committed by GitHub
parent 73d795f426
commit 43e0968dac
2 changed files with 25 additions and 9 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ func (api *API) debugDeploymentHealth(rw http.ResponseWriter, r *http.Request) {
// Get cached report if it exists.
if report := api.healthCheckCache.Load(); report != nil {
if time.Since(report.Time) < api.HealthcheckRefresh {
httpapi.Write(ctx, rw, http.StatusOK, report)
httpapi.WriteIndent(ctx, rw, http.StatusOK, report)
return
}
}
@@ -61,7 +61,7 @@ func (api *API) debugDeploymentHealth(rw http.ResponseWriter, r *http.Request) {
})
return
case res := <-resChan:
httpapi.Write(ctx, rw, http.StatusOK, res.Val)
httpapi.WriteIndent(ctx, rw, http.StatusOK, res.Val)
return
}
}