feature: Ward Gateway Service (Local-First Clinical Path)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
using StackExchange.Redis;
|
||||
|
||||
public sealed class RedisHealthCheck : IHealthCheck
|
||||
{
|
||||
private readonly IConnectionMultiplexer _redis;
|
||||
|
||||
public RedisHealthCheck(IConnectionMultiplexer redis) => _redis = redis;
|
||||
|
||||
public async Task<HealthCheckResult> CheckHealthAsync(
|
||||
HealthCheckContext context, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var db = _redis.GetDatabase();
|
||||
var latency = await db.PingAsync();
|
||||
var data = new Dictionary<string, object> { ["ping_ms"] = latency.TotalMilliseconds };
|
||||
return HealthCheckResult.Healthy(data: data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user