mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Improve indexer health check messages (#1015)
* Improve indexer health check messages Fixed: Improve health check message when all enabled indexers are disabled due to failures Closes #1551 * Fixed: Health check failing and preventing others from running * Fixed Indexer Health Checks and tests.
This commit is contained in:

committed by
Devin Buhl

parent
7433e89467
commit
9787cf6cdd
35
src/NzbDrone.Core/HealthCheck/Checks/IndexerSearchCheck.cs
Normal file
35
src/NzbDrone.Core/HealthCheck/Checks/IndexerSearchCheck.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Linq;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Indexers;
|
||||
|
||||
namespace NzbDrone.Core.HealthCheck.Checks
|
||||
{
|
||||
public class IndexerSearchCheck : HealthCheckBase
|
||||
{
|
||||
private readonly IIndexerFactory _indexerFactory;
|
||||
|
||||
public IndexerSearchCheck(IIndexerFactory indexerFactory)
|
||||
{
|
||||
_indexerFactory = indexerFactory;
|
||||
}
|
||||
|
||||
public override HealthCheck Check()
|
||||
{
|
||||
var enabled = _indexerFactory.SearchEnabled(false);
|
||||
|
||||
if (enabled.Empty())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No indexers available with Search enabled, Sonarr will not provide any search results");
|
||||
}
|
||||
|
||||
var active = _indexerFactory.SearchEnabled(true);
|
||||
|
||||
if (active.Empty())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "All search-capable indexers are temporarily unavailable due to recent indexer errors");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user