Files
components/LiteCharms.Features/Extensions/HealthChecks.cs
T
Khwezi Mngoma 7d5e9a18d8
continuous-integration/drone/pr Build is failing
Added MidrandShop feature and spl;it extensions and healthchecks
2026-05-23 11:48:47 +02:00

50 lines
1.6 KiB
C#

using LiteCharms.Features.HealthChecks;
using static LiteCharms.Features.Extensions.Postgres;
namespace LiteCharms.Features.Extensions;
public static class HealthChecks
{
public static IServiceCollection AddShopQuartzHealthCheck(this IServiceCollection services)
{
services.AddHealthChecks().AddCheck<ShopQuartzHealthCheck>("ShopQuartz");
return services;
}
public static IServiceCollection AddMidrandShopQuartzHealthCheck(this IServiceCollection services)
{
services.AddHealthChecks().AddCheck<MidrandShopQuartzHealthCheck>("MidrandShopQuartz");
return services;
}
public static IServiceCollection AddShopPostgresHealthCheck(this IServiceCollection services)
{
services.AddHealthChecks().AddCheck<PostgresShopHealthCheck>(ShopDbConfigName);
return services;
}
public static IServiceCollection AddMidrandShopPostgresHealthCheck(this IServiceCollection services)
{
services.AddHealthChecks().AddCheck<PostgresMidrandShopHealthCheck>(MidrandShopDbConfigName);
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;
}
}