From 1e8ef647f7d1979a8bacd2b857c6e721c9300be6 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 13 Aug 2019 17:30:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=94=B9=E5=81=A5?= =?UTF-8?q?=E5=BA=B7=E6=A3=80=E6=9F=A5=E8=BF=94=E5=9B=9E=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HealthChecks/HealthChecksAppBuilderExtensions.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Bootstrap.Admin/HealthChecks/HealthChecksAppBuilderExtensions.cs b/Bootstrap.Admin/HealthChecks/HealthChecksAppBuilderExtensions.cs index 3b07e2f5..f84c4b25 100644 --- a/Bootstrap.Admin/HealthChecks/HealthChecksAppBuilderExtensions.cs +++ b/Bootstrap.Admin/HealthChecks/HealthChecksAppBuilderExtensions.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Diagnostics.HealthChecks; using Newtonsoft.Json; namespace Microsoft.AspNetCore.Builder @@ -24,6 +25,12 @@ namespace Microsoft.AspNetCore.Builder { context.Response.ContentType = "application/json"; return context.Response.WriteAsync(JsonConvert.SerializeObject(report)); + }, + ResultStatusCodes = + { + [HealthStatus.Healthy] = StatusCodes.Status200OK, + [HealthStatus.Degraded] = StatusCodes.Status200OK, + [HealthStatus.Unhealthy] = StatusCodes.Status200OK } }); return app;