42001998d6
Refactored mappers
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using LiteCharms.Features.HealthChecks;
|
|
|
|
namespace LiteCharms.Features.Extensions;
|
|
|
|
public static class HealthChecks
|
|
{
|
|
public static IServiceCollection AddQuartzHealtchCheck(this IServiceCollection services)
|
|
{
|
|
services.AddHealthChecks().AddCheck<QuartzHealthCheck>("Quartz");
|
|
|
|
return services;
|
|
}
|
|
|
|
public static IServiceCollection AddPostgresHealtchCheck(this IServiceCollection services)
|
|
{
|
|
services.AddHealthChecks().AddCheck<PostgresHealthCheck>("PostgreSQL");
|
|
|
|
return services;
|
|
}
|
|
|
|
public static IServiceCollection AddHealthChecksSupport(this IServiceCollection services, IConfiguration configuration)
|
|
{
|
|
services.AddHealthChecks()
|
|
.AddCheck("Self", () => HealthCheckResult.Healthy());
|
|
|
|
//services.AddHealthChecksUI(setup =>
|
|
//{
|
|
// setup.AddHealthCheckEndpoint("Lead Generator", $"{configuration["ASPNETCORE_URLS"]}/health");
|
|
// setup.SetEvaluationTimeInSeconds(15);
|
|
//}).AddInMemoryStorage(databaseName: "healthuidb");
|
|
|
|
return services;
|
|
}
|
|
}
|