mirror of https://github.com/Sonarr/Sonarr
Fixed: Multiple pushed releases will be processed sequentially
Closes #2975
This commit is contained in:
parent
40ce54e165
commit
1f8e1cf582
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using FluentValidation.Results;
|
using FluentValidation.Results;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
@ -23,6 +24,8 @@ namespace Sonarr.Api.V3.Indexers
|
||||||
private readonly IIndexerFactory _indexerFactory;
|
private readonly IIndexerFactory _indexerFactory;
|
||||||
private readonly Logger _logger;
|
private readonly Logger _logger;
|
||||||
|
|
||||||
|
private static readonly object PushLock = new object();
|
||||||
|
|
||||||
public ReleasePushController(IMakeDownloadDecision downloadDecisionMaker,
|
public ReleasePushController(IMakeDownloadDecision downloadDecisionMaker,
|
||||||
IProcessDownloadDecisions downloadDecisionProcessor,
|
IProcessDownloadDecisions downloadDecisionProcessor,
|
||||||
IIndexerFactory indexerFactory,
|
IIndexerFactory indexerFactory,
|
||||||
|
@ -55,8 +58,13 @@ namespace Sonarr.Api.V3.Indexers
|
||||||
|
|
||||||
ResolveIndexer(info);
|
ResolveIndexer(info);
|
||||||
|
|
||||||
var decisions = _downloadDecisionMaker.GetRssDecision(new List<ReleaseInfo> { info });
|
List<DownloadDecision> decisions;
|
||||||
|
|
||||||
|
lock (PushLock)
|
||||||
|
{
|
||||||
|
decisions = _downloadDecisionMaker.GetRssDecision(new List<ReleaseInfo> { info });
|
||||||
_downloadDecisionProcessor.ProcessDecisions(decisions);
|
_downloadDecisionProcessor.ProcessDecisions(decisions);
|
||||||
|
}
|
||||||
|
|
||||||
var firstDecision = decisions.FirstOrDefault();
|
var firstDecision = decisions.FirstOrDefault();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue