From b386af1ccc1ad26774abba2326d42aadca452fff Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 25 Sep 2019 00:03:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(#I12MIP):=20Gitee=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=81=A5=E5=BA=B7=E6=A3=80=E6=9F=A5=E5=8F=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Comment comment #I12MIP #Issue close https://gitee.com/LongbowEnterprise/dashboard/issues?id=I12MIP --- .../HealthChecks/HealthChecksBuilderExtensions.cs | 6 +++++- src/admin/Bootstrap.Admin/appsettings.json | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/admin/Bootstrap.Admin/HealthChecks/HealthChecksBuilderExtensions.cs b/src/admin/Bootstrap.Admin/HealthChecks/HealthChecksBuilderExtensions.cs index ebcb5d58..20889596 100644 --- a/src/admin/Bootstrap.Admin/HealthChecks/HealthChecksBuilderExtensions.cs +++ b/src/admin/Bootstrap.Admin/HealthChecks/HealthChecksBuilderExtensions.cs @@ -1,4 +1,5 @@ using Bootstrap.Admin.HealthChecks; +using Microsoft.Extensions.Configuration; namespace Microsoft.Extensions.DependencyInjection { @@ -17,7 +18,10 @@ namespace Microsoft.Extensions.DependencyInjection var builder = services.AddHealthChecks(); builder.AddCheck("db"); builder.AddBootstrapAdminHealthChecks(); - builder.AddCheck("Gitee"); + + var config = services.BuildServiceProvider().GetRequiredService(); + var checkGitee = config.GetValue("GiteeHealthChecks", false); + if (checkGitee) builder.AddCheck("Gitee"); return services; } } diff --git a/src/admin/Bootstrap.Admin/appsettings.json b/src/admin/Bootstrap.Admin/appsettings.json index 605fc91e..877e3667 100644 --- a/src/admin/Bootstrap.Admin/appsettings.json +++ b/src/admin/Bootstrap.Admin/appsettings.json @@ -55,6 +55,7 @@ ], "SwaggerPathBase": "", "AllowOrigins": "http://localhost,http://ba.sdgxgz.cn", + "GiteeHealthChecks": false, "Sentry": { "Dsn": "https://70bdfff562e84fa7b9a43d65924ab9ad@sentry.io/1469396" },