Beispiel #1
0
        public void Handle(HealthCheckFailedEvent message)
        {
            // Don't send health check notifications during the start up grace period,
            // once that duration expires they they'll be retested and fired off if necessary.

            if (message.IsInStartupGraceperiod)
            {
                return;
            }

            foreach (var notification in _notificationFactory.OnHealthIssueEnabled())
            {
                try
                {
                    if (ShouldHandleHealthFailure(message.HealthCheck, ((NotificationDefinition)notification.Definition).IncludeHealthWarnings))
                    {
                        notification.OnHealthIssue(message.HealthCheck);
                    }
                }

                catch (Exception ex)
                {
                    _logger.Warn(ex, "Unable to send OnHealthIssue notification to: " + notification.Definition.Name);
                }
            }
        }
Beispiel #2
0
 public void Handle(HealthCheckFailedEvent message)
 {
     foreach (var notification in _notificationFactory.OnHealthIssueEnabled())
     {
         try
         {
             if (ShouldHandleHealthFailure(message.HealthCheck, ((NotificationDefinition)notification.Definition).IncludeHealthWarnings))
             {
                 notification.OnHealthIssue(message.HealthCheck);
             }
         }
         catch (Exception ex)
         {
             _logger.Warn(ex, "Unable to send OnHealthIssue notification to: " + notification.Definition.Name);
         }
     }
 }