Skip to content

Commit

Permalink
Format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cieciurm committed Jul 7, 2023
1 parent 66f898f commit 6213275
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/HealthChecks.UI/Configuration/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public Settings DisableDatabaseMigrations()
return this;
}

public Settings NotifyUnHealthyOnceTimeUntilChangeToAvoidNotificationSpam() {
public Settings NotifyUnHealthyOnceTimeUntilChangeToAvoidNotificationSpam()
{
NotifyUnHealthyOnceTimeUntilChange = true;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public async Task Collect(CancellationToken cancellationToken)

if (healthReport.Status != UIHealthStatus.Healthy)
{
if (! _settings.NotifyUnHealthyOnceTimeUntilChange || await ShouldNotify(item.Name, healthReport))
if (!_settings.NotifyUnHealthyOnceTimeUntilChange || await ShouldNotify(item.Name, healthReport))
{
await _healthCheckFailureNotifier.NotifyDown(item.Name, healthReport);
}
}
}
else
{
Expand Down Expand Up @@ -176,11 +176,11 @@ private async Task<bool> HasLivenessRecoveredFromFailureAsync(HealthCheckConfigu
.SingleOrDefaultAsync();
}

private async Task<bool> ShouldNotify(string healthCheckName , UIHealthReport report)
private async Task<bool> ShouldNotify(string healthCheckName, UIHealthReport report)

{
var lastNotifications = await _db.Failures
.Where(lf => lf.HealthCheckName.ToLower() == healthCheckName.ToLower())
.Where(lf => string.Equals(lf.HealthCheckName, healthCheckName, StringComparison.OrdinalIgnoreCase))
.OrderByDescending(lf => lf.LastNotified)
.Take(2).ToListAsync();

Expand Down

0 comments on commit 6213275

Please sign in to comment.