diff --git a/src/Sonarr.Api.V3/Indexers/ReleasePushController.cs b/src/Sonarr.Api.V3/Indexers/ReleasePushController.cs index 816ebf5b6..fe9da8043 100644 --- a/src/Sonarr.Api.V3/Indexers/ReleasePushController.cs +++ b/src/Sonarr.Api.V3/Indexers/ReleasePushController.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using System.Threading; using FluentValidation; using FluentValidation.Results; using Microsoft.AspNetCore.Mvc; @@ -23,6 +24,8 @@ namespace Sonarr.Api.V3.Indexers private readonly IIndexerFactory _indexerFactory; private readonly Logger _logger; + private static readonly object PushLock = new object(); + public ReleasePushController(IMakeDownloadDecision downloadDecisionMaker, IProcessDownloadDecisions downloadDecisionProcessor, IIndexerFactory indexerFactory, @@ -55,8 +58,13 @@ namespace Sonarr.Api.V3.Indexers ResolveIndexer(info); - var decisions = _downloadDecisionMaker.GetRssDecision(new List { info }); - _downloadDecisionProcessor.ProcessDecisions(decisions); + List decisions; + + lock (PushLock) + { + decisions = _downloadDecisionMaker.GetRssDecision(new List { info }); + _downloadDecisionProcessor.ProcessDecisions(decisions); + } var firstDecision = decisions.FirstOrDefault();