creates simple healthchecks
This commit is contained in:
26
ImAliveHealthcheck.cs
Normal file
26
ImAliveHealthcheck.cs
Normal 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
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user