SQL HealthCheck

This commit is contained in:
dingo
2025-11-07 16:42:02 -05:00
parent 27d9c5fdd5
commit a668858d7f
+4 -1
View File
@@ -33,7 +33,10 @@ builder.Services.AddOptions<DatabaseOptions>()
.Validate(o => !string.IsNullOrWhiteSpace(o.ConnectionString), "DB connection string required")
.ValidateOnStart();
// (Optional) health checks / metrics can be added here too.
builder.Services.AddHealthChecks()
.AddCheck<DatabaseHealthCheck>("mysql", tags: new[] { "ready" })
//.AddCheck<RedisHealthCheck>("redis", tags: new[] { "ready" })
;
// ---- Build the app AFTER all service registrations ----
var app = builder.Build();