Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

Commit

Permalink
fixes #31 allow slack alerts to be disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
alhardy committed Jul 9, 2018
1 parent b540a74 commit 1175a20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ public class SlackHealthAlertOptions
public string EmojiIcon { get; set; }

public bool AlertOnDegradedChecks { get; set; } = true;

public bool Enabled { get; set; } = true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public SlackIncomingWebHookHealthAlerter(SlackHealthAlertOptions slackOptions)
/// <inheritdoc />
public async Task ReportAsync(HealthOptions options, HealthStatus status, CancellationToken cancellationToken = default)
{
if (!_slackOptions.Enabled)
{
return;
}

var applicationName = options.ApplicationName;

if (Uri.TryCreate(applicationName, UriKind.Absolute, out var appUri))
Expand Down

0 comments on commit 1175a20

Please sign in to comment.