1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-10-03 22:57:18 +02:00

Fixed: Multiple pushed releases will be processed sequentially

(cherry picked from commit 1f8e1cf582f59fe1e8dcc0fad15afeed6d9cd9d1)
This commit is contained in:
Mark McDowall 2022-12-25 23:20:43 -08:00 committed by Qstick
parent 7feda1c446
commit e085f6af8a

View File

@ -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 @@ public class ReleasePushController : ReleaseControllerBase
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 @@ public ActionResult<List<ReleaseResource>> Create(ReleaseResource release)
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();