fix(#I12MIP): Gitee 接口健康检查可配置

#Comment
comment #I12MIP

#Issue
close https://gitee.com/LongbowEnterprise/dashboard/issues?id=I12MIP
This commit is contained in:
Argo Zhang 2019-09-25 00:03:46 +08:00
parent 3fff9fa555
commit b386af1ccc
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
2 changed files with 6 additions and 1 deletions

View File

@ -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<DBHealthCheck>("db");
builder.AddBootstrapAdminHealthChecks();
builder.AddCheck<GiteeHttpHealthCheck>("Gitee");
var config = services.BuildServiceProvider().GetRequiredService<IConfiguration>();
var checkGitee = config.GetValue("GiteeHealthChecks", false);
if (checkGitee) builder.AddCheck<GiteeHttpHealthCheck>("Gitee");
return services;
}
}

View File

@ -55,6 +55,7 @@
],
"SwaggerPathBase": "",
"AllowOrigins": "http://localhost,http://ba.sdgxgz.cn",
"GiteeHealthChecks": false,
"Sentry": {
"Dsn": "https://70bdfff562e84fa7b9a43d65924ab9ad@sentry.io/1469396"
},