Cleanup other provider status code

(cherry picked from commit c281a7818adce8db728d2a104f4444cb9c0baf2c)
pull/4015/head
Qstick 1 year ago committed by Bogdan
parent 7f4b79f84d
commit 5ebab69ff5

@ -56,11 +56,11 @@ namespace NzbDrone.Core.Download
private IEnumerable<IDownloadClient> FilterBlockedClients(IEnumerable<IDownloadClient> clients)
{
var blockedIndexers = _downloadClientStatusService.GetBlockedProviders().ToDictionary(v => v.ProviderId, v => v);
var blockedClients = _downloadClientStatusService.GetBlockedProviders().ToDictionary(v => v.ProviderId, v => v);
foreach (var client in clients)
{
if (blockedIndexers.TryGetValue(client.Definition.Id, out var downloadClientStatus))
if (blockedClients.TryGetValue(client.Definition.Id, out var downloadClientStatus))
{
_logger.Debug("Temporarily ignoring download client {0} till {1} due to recent failures.", client.Definition.Name, downloadClientStatus.DisabledTill.Value.ToLocalTime());
continue;

@ -1,4 +1,4 @@
using Dapper;
using Dapper;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.Housekeeping.Housekeepers
@ -15,6 +15,7 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
public void Clean()
{
using var mapper = _database.OpenConnection();
mapper.Execute(@"DELETE FROM ""DownloadClientStatus""
WHERE ""Id"" IN (
SELECT ""DownloadClientStatus"".""Id"" FROM ""DownloadClientStatus""

Loading…
Cancel
Save