Skip to content

Commit

Permalink
fix(healthchecks): Removed redundant ping check
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusjar committed Apr 20, 2023
1 parent de4baad commit 1751305
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 95 deletions.
47 changes: 0 additions & 47 deletions src/Ombi.HealthChecks/Checks/OmbiPingHealthCheck.cs

This file was deleted.

16 changes: 0 additions & 16 deletions src/Ombi.HealthChecks/Checks/OmbiPingHealthCheckOptions.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Ombi.HealthChecks/Checks/PlexHealthCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override async Task<HealthCheckResult> CheckHealthAsync(
var settings = await settingsProvider.GetSettingsAsync();
if (settings == null)
{
return HealthCheckResult.Healthy("Plex is not confiured.");
return HealthCheckResult.Healthy("Plex is not configured.");
}

var taskResult = new List<Task<PlexStatus>>();
Expand Down
31 changes: 0 additions & 31 deletions src/Ombi.HealthChecks/HealthCheckExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,8 @@ public static IHealthChecksBuilder AddOmbiHealthChecks(this IHealthChecksBuilder
builder.AddCheck<RadarrHealthCheck>("Radarr", tags: new string[] { "DVR" });
builder.AddCheck<CouchPotatoHealthCheck>("CouchPotato", tags: new string[] { "DVR" });
builder.AddCheck<SickrageHealthCheck>("SickRage", tags: new string[] { "DVR" });
builder.AddOmbiPingHealthCheck(options =>
{
options.AddHost("www.google.co.uk", 5000, HealthStatus.Unhealthy);
options.AddHost("www.google.com", 3000, HealthStatus.Degraded);
}, "External Ping", tags: new string[] { "System" });

return builder;
}

/// <summary>
/// Add a health check for network ping.
/// </summary>
/// <param name="builder">The <see cref="IHealthChecksBuilder"/>.</param>
/// <param name="setup">The action to configure the ping parameters.</param>
/// <param name="name">The health check name. Optional. If <c>null</c> the type name 'ping' will be used for the name.</param>
/// <param name="failureStatus">
/// The <see cref="HealthStatus"/> that should be reported when the health check fails. Optional. If <c>null</c> then
/// the default status of <see cref="HealthStatus.Unhealthy"/> will be reported.
/// </param>
/// <param name="tags">A list of tags that can be used to filter sets of health checks. Optional.</param>
/// <param name="timeout">An optional System.TimeSpan representing the timeout of the check.</param>
/// <returns>The <see cref="IHealthChecksBuilder"/>.</returns></param>
public static IHealthChecksBuilder AddOmbiPingHealthCheck(this IHealthChecksBuilder builder, Action<OmbiPingHealthCheckOptions> setup, string name = default, HealthStatus? failureStatus = default, IEnumerable<string> tags = default, TimeSpan? timeout = default)
{
var options = new OmbiPingHealthCheckOptions();
setup?.Invoke(options);

return builder.Add(new HealthCheckRegistration(
name,
sp => new OmbiPingHealthCheck(options),
failureStatus,
tags,
timeout));
}
}
}

0 comments on commit 1751305

Please sign in to comment.