creates simple healthchecks

This commit is contained in:
2025-08-25 23:46:04 +02:00
commit b81eb5b9f5
21 changed files with 2835 additions and 0 deletions

26
ImAliveHealthcheck.cs Normal file
View File

@@ -0,0 +1,26 @@
using MCVIngenieros.Healthchecks.Abstracts;
namespace MCVIngenieros.Healthchecks;
public class ImAliveHealthcheck : IHealthCheck
{
public int? RetryAttempts => 1;
public TimeSpan? Timeout => null;
public TimeSpan? RetryDelay => TimeSpan.Zero;
public HealthCheckSeverity? Severity => HealthCheckSeverity.Info;
public string? Description => "Simplest HealthCheck that can be done. It just says: API is alive.";
public Task<HealthCheckResult> CheckAsync(CancellationToken cancellationToken = default)
{
return Task.FromResult(new HealthCheckResult()
{
Details = "API is alive",
Severity = HealthCheckSeverity.Info,
IsHealthy = true
});
}
}