Skip to content

Commit

Permalink
Fixed: Multiple pushed releases will be processed sequentially
Browse files Browse the repository at this point in the history
(cherry picked from commit 1f8e1cf582f59fe1e8dcc0fad15afeed6d9cd9d1)
  • Loading branch information
markus101 authored and Qstick committed Jan 2, 2023
1 parent 7feda1c commit e085f6a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Radarr.Api.V3/Indexers/ReleasePushController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using FluentValidation;
using FluentValidation.Results;
using Microsoft.AspNetCore.Mvc;
Expand All @@ -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,
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit e085f6a

Please sign in to comment.