mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
parent
f350ae242b
commit
4a35126bf6
@ -189,11 +189,13 @@ func (hs *HttpServer) healthHandler(ctx *macaron.Context) {
|
||||
|
||||
if err := bus.Dispatch(&models.GetDBHealthQuery{}); err != nil {
|
||||
data.Set("database", "failing")
|
||||
ctx.Resp.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
ctx.Resp.WriteHeader(503)
|
||||
} else {
|
||||
ctx.Resp.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
ctx.Resp.WriteHeader(200)
|
||||
}
|
||||
|
||||
ctx.Resp.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
ctx.Resp.WriteHeader(200)
|
||||
|
||||
dataBytes, _ := data.EncodePretty()
|
||||
ctx.Resp.Write(dataBytes)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user