This commit is contained in:
@@ -261,10 +261,8 @@ namespace Sockeye.Biz
|
||||
if (!KeepOnWorking()) return;
|
||||
|
||||
//SOCKBOT - SUBSCRIPTION SERVER HEALTH CHECKS
|
||||
|
||||
|
||||
|
||||
|
||||
await SockBotSubscriptionServerHealthChecks.DoWorkAsync();
|
||||
if (!KeepOnWorking()) return;
|
||||
|
||||
//JOB SWEEPER
|
||||
await CoreJobSweeper.DoWorkAsync();
|
||||
|
||||
@@ -12,14 +12,14 @@ namespace Sockeye.Biz
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Check the health of subscribers servers, basically a ping check
|
||||
/// trigger notification if any fail the test excessively (some slack for intermittent comm. issues)
|
||||
/// Check the health of subscribers servers using the /health endpoint
|
||||
/// trigger notification if any fail the test 3 times (some slack for intermittent comm. issues)
|
||||
/// </summary>
|
||||
internal static class SockBotSubscriptionServerHealthChecks
|
||||
{
|
||||
private static ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger("SockBotSubscriptionServerHealthChecks");
|
||||
private static DateTime lastSweep = DateTime.MinValue;
|
||||
private static TimeSpan HEALTHCHECK_EVERY_INTERVAL = new TimeSpan(0, 15, 10);//every 15 minutes roughly
|
||||
private static TimeSpan HEALTHCHECK_EVERY_INTERVAL = new TimeSpan(0, 5, 10);//every 5 minutes roughly meaning 15 minutes down is highest fail state
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// DoSweep
|
||||
//
|
||||
@@ -71,6 +71,7 @@ namespace Sockeye.Biz
|
||||
var responseText = await res.Content.ReadAsStringAsync();
|
||||
srv.LastHealthCheck = DateTime.UtcNow;
|
||||
srv.LastHealthStatus = responseText;
|
||||
log.LogDebug($"Health check server {srv.Name} response {responseText}");
|
||||
if (res.IsSuccessStatusCode && responseText == "Healthy")
|
||||
{
|
||||
//a-ok
|
||||
|
||||
Reference in New Issue
Block a user