Table of Contents

Class RecoveryHealthCheck

Namespace
Virtufin.WorkManager.Services
Assembly
Virtufin.WorkManager.dll

Health check that verifies worker recovery has completed successfully.

public sealed class RecoveryHealthCheck : IHealthCheck
Inheritance
RecoveryHealthCheck
Implements
Inherited Members

Constructors

RecoveryHealthCheck(RecoveryState)

Creates a new RecoveryHealthCheck.

public RecoveryHealthCheck(RecoveryState recoveryState)

Parameters

recoveryState RecoveryState

Methods

CheckHealthAsync(HealthCheckContext, CancellationToken)

Runs the health check, returning the status of the component being checked.

public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)

Parameters

context HealthCheckContext

A context object associated with the current execution.

cancellationToken CancellationToken

A CancellationToken that can be used to cancel the health check.

Returns

Task<HealthCheckResult>

A Task<TResult> that completes when the health check has finished, yielding the status of the component being checked.

Remarks

Returns Unhealthy (not Degraded) while recovery is still in progress -- this check's whole purpose is to gate Kestrel readiness (see RecoveryState's doc comment), and Degraded maps to HTTP 200 under ASP.NET Core's default health-check status-code mapping, identical to Healthy. That made this check inert as a readiness gate since it was written: a pod with recovery still in progress was reported Ready immediately.