IHealthCheck.CheckHealthAsync(HealthCheckContext, CancellationToken) Method

Definition

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

public System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult> CheckHealthAsync (Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext context, System.Threading.CancellationToken cancellationToken = null);
abstract member CheckHealthAsync : Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult>

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

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

Applies to