From 5ec4a22a3bf59736fd50351064165cfcdf4dc1f4 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 24 Feb 2023 23:50:49 +0000 Subject: [PATCH] --- server/generator/SockBotSubscriptionServerHealthChecks.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/generator/SockBotSubscriptionServerHealthChecks.cs b/server/generator/SockBotSubscriptionServerHealthChecks.cs index 788a668..3e9dcfe 100644 --- a/server/generator/SockBotSubscriptionServerHealthChecks.cs +++ b/server/generator/SockBotSubscriptionServerHealthChecks.cs @@ -61,12 +61,15 @@ namespace Sockeye.Biz } else { + //space things out a bit to not "Hammer" out calls + await Task.Delay(1000);//1 second delay between calls //https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks?source=recommendations&view=aspnetcore-7.0 //https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks?source=recommendations&view=aspnetcore-7.0#customize-the-http-status-code //Basically it returns only plain text //http status code = 200 for both Healthy and Degraded //http status code = 503 for UnHealthy //for our purposes anything other than 200 and "Healthy" is a problem + var res = await client.GetAsync($"https://{srv.Name}/health"); var responseText = await res.Content.ReadAsStringAsync(); srv.LastHealthCheck = DateTime.UtcNow;