Added abstractions

Internal service bus support enabled
Added quartz support
Reconfigured extensions
This commit is contained in:
Khwezi Mngoma
2026-05-07 16:08:47 +02:00
parent c6ce9c85df
commit acc0d44c7c
31 changed files with 570 additions and 47 deletions
@@ -0,0 +1,23 @@
namespace LiteCharms.Infrastructure.HealthChecks;
public class QuartzHealthCheck(ISchedulerFactory schedulerFactory) : IHealthCheck
{
public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
{
try
{
var scheduler = await schedulerFactory.GetScheduler(cancellationToken);
if (!scheduler.IsStarted)
return HealthCheckResult.Unhealthy("Quartz scheduler is not running");
await scheduler.CheckExists(new JobKey(Guid.NewGuid().ToString()), cancellationToken);
return HealthCheckResult.Healthy("Quartz scheduler is ready");
}
catch (SchedulerException)
{
return HealthCheckResult.Unhealthy("Quartz scheduler cannot connect to the store");
}
}
}