BootstrapAdmin/Bootstrap.Admin/HealthChecks/HealthChecksBuilderExtensio...

25 lines
760 B
C#
Raw Normal View History

using Bootstrap.Admin.HealthChecks;
namespace Microsoft.Extensions.DependencyInjection
2019-08-13 13:39:18 +08:00
{
/// <summary>
/// 健康检查扩展类
/// </summary>
public static class HealthChecksBuilderExtensions
{
/// <summary>
/// 添加 BootstrapAdmin 健康检查
/// </summary>
/// <param name="services"></param>
2019-08-13 13:39:18 +08:00
/// <returns></returns>
public static IServiceCollection AddAdminHealthChecks(this IServiceCollection services)
2019-08-13 13:39:18 +08:00
{
var builder = services.AddHealthChecks();
builder.AddCheck<DBHealthCheck>("db");
builder.AddBootstrapAdminHealthChecks();
2019-08-13 15:55:55 +08:00
builder.AddCheck<GiteeHttpHealthCheck>("Gitee");
return services;
2019-08-13 13:39:18 +08:00
}
}
}