27 lines
739 B
C#
27 lines
739 B
C#
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
|
|
});
|
|
}
|
|
}
|