Break up the list of Health Checks to be more readable and change the Slack icons

This commit is contained in:
Jeavon Leopold
2017-06-05 13:52:48 +02:00
parent a102a7c094
commit 57ce6d7f64
2 changed files with 11 additions and 4 deletions

View File

@@ -68,13 +68,20 @@ namespace Umbraco.Web.HealthCheck
var checkName = result.Key;
var checkResults = result.Value;
var checkIsSuccess = result.Value.All(x => x.ResultType == StatusResultType.Success);
// add a new line if not the first check
if (result.Equals(_results.First()) == false)
{
sb.Append(Environment.NewLine);
}
if (checkIsSuccess)
{
sb.AppendFormat("{0}Checks for'{1}' all completed succesfully.{2}", newItem, checkName, Environment.NewLine);
sb.AppendFormat("{0}Checks for '{1}' all completed succesfully.{2}", newItem, checkName, Environment.NewLine);
}
else
{
sb.AppendFormat("{0}Checks for'{1}' completed with errors.{2}", newItem, checkName, Environment.NewLine);
sb.AppendFormat("{0}Checks for '{1}' completed with errors.{2}", newItem, checkName, Environment.NewLine);
}
foreach (var checkResult in checkResults)

View File

@@ -89,10 +89,10 @@ namespace Umbraco.Web.Scheduling
{
var slackClient = new SlackClient(healthCheckConfig.NotificationSettings.SlackSettings.WebHookUrl);
var icon = Emoji.MinusOne;
var icon = Emoji.Warning;
if (results.AllChecksSuccessful)
{
icon = Emoji.PlusOne;
icon = Emoji.WhiteCheckMark;
}
var slackMessage = new SlackMessage