示例#1
0
        private dynamic GetHealthStatus()
        {
            var status  = Config.HealthStatus();
            var content = HealthCheckSerializer.Serialize(status);

            var response = Response.AsText(content, "application/json");

            response.StatusCode = status.IsHealty ? HttpStatusCode.OK : HttpStatusCode.InternalServerError;
            return(response);
        }
示例#2
0
        private Response GetHealthStatus()
        {
            var status  = Config.HealthStatus();
            var content = JsonHealthChecks.BuildJson(status);

            var response = Response.AsText(content, "application/json");

            if (!healthChecksAlwaysReturnHttpStatusOk)
            {
                response.StatusCode = status.IsHealthy ? HttpStatusCode.OK : HttpStatusCode.InternalServerError;
            }
            else
            {
                response.StatusCode = HttpStatusCode.OK;
            }
            return(response);
        }