mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Fixed: Multiple pushed releases will be processed sequentially
(cherry picked from commit 1f8e1cf582f59fe1e8dcc0fad15afeed6d9cd9d1)
This commit is contained in:
parent
1980173d86
commit
8bddb1ae7e
1 changed files with 10 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
using Lidarr.Http;
|
||||
|
@ -23,6 +24,8 @@ namespace Lidarr.Api.V1.Indexers
|
|||
private readonly IIndexerFactory _indexerFactory;
|
||||
private readonly Logger _logger;
|
||||
|
||||
private static readonly object PushLock = new object();
|
||||
|
||||
public ReleasePushController(IMakeDownloadDecision downloadDecisionMaker,
|
||||
IProcessDownloadDecisions downloadDecisionProcessor,
|
||||
IIndexerFactory indexerFactory,
|
||||
|
@ -54,8 +57,13 @@ namespace Lidarr.Api.V1.Indexers
|
|||
|
||||
ResolveIndexer(info);
|
||||
|
||||
var decisions = _downloadDecisionMaker.GetRssDecision(new List<ReleaseInfo> { info });
|
||||
_downloadDecisionProcessor.ProcessDecisions(decisions);
|
||||
List<DownloadDecision> decisions;
|
||||
|
||||
lock (PushLock)
|
||||
{
|
||||
decisions = _downloadDecisionMaker.GetRssDecision(new List<ReleaseInfo> { info });
|
||||
_downloadDecisionProcessor.ProcessDecisions(decisions);
|
||||
}
|
||||
|
||||
var firstDecision = decisions.FirstOrDefault();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue