Merge branch 'feature/health-check-scheduler' of https://github.com/AndyButland/Umbraco-CMS into temp-U4-9984

This commit is contained in:
Jeavon Leopold
2017-06-05 10:18:26 +02:00
7 changed files with 60 additions and 16 deletions

View File

@@ -1,3 +1,5 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
@@ -51,14 +53,8 @@ namespace Umbraco.Web.Scheduling
var checks = _healthCheckResolver.HealthChecks
.Where(x => disabledCheckIds.Contains(x.Id) == false);
var sb = new StringBuilder();
foreach (var check in checks)
{
// TODO: get all sub-checks, not just first
var status = check.GetStatus().First();
sb.AppendFormat(" - Check {0} returned {1} with message {2}.", check.Name, status.ResultType, status.Message);
sb.AppendLine();
}
var results = new HealthCheckResults(checks);
results.LogResults();
// TODO: get email address and send
if (!string.IsNullOrEmpty(healthCheckConfig.NotificationSettings.RecipientEmail))
@@ -79,9 +75,6 @@ namespace Umbraco.Web.Scheduling
};
slackClient.Post(slackMessage);
}
LogHelper.Info<HealthCheckNotifier>("Health check results:");
LogHelper.Info<HealthCheckNotifier>(sb.ToString());
}
return true; // repeat