Update conf start HealthCheck serv

This commit is contained in:
Samuele Locatelli
2024-05-09 16:41:57 +02:00
parent a0bbf356a9
commit f273aaaf5a
7 changed files with 51 additions and 40 deletions
+11 -2
View File
@@ -76,9 +76,8 @@ builder.Services.AddHealthChecks()
builder.Services
.AddHealthChecksUI(s =>
{
s.AddHealthCheckEndpoint("WDC.UI_Services", "health");
s.AddHealthCheckEndpoint("WDC_UI_HC", "health");
s.SetEvaluationTimeInSeconds(60);
//s.SetEvaluationTimeInSeconds(60);
s.SetMinimumSecondsBetweenFailureNotifications(120);
s.SetApiMaxActiveRequests(5);
s.SetHeaderText("WDC.UI Health Check Status");
@@ -181,11 +180,21 @@ app.UseAuthorization();
app.MapControllers();
app.MapBlazorHub();
// config healthcheck: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks
// prende tutti i predicati
app.MapHealthChecks("/health", new HealthCheckOptions
{
Predicate = _ => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
// nasconde tutti i dettagli
app.MapHealthChecks("/health/live", new HealthCheckOptions
{
Predicate = _ => false
});
app.MapFallbackToPage("/_Host");
app.Run();