Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Readarr/commit/c31a797bd87178f1e1ed12080e8c7bc0492052c0?style=unified&whitespace=ignore-all You should set ROOT_URL correctly, otherwise the web may not work correctly.

Revert "Switch to Parallel.ForEach for list processing with MaxParallelism"

This reverts commit ebb2b4eca3.
pull/2859/head
Bogdan 2 years ago
parent ebb2b4eca3
commit c31a797bd8

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NLog;
using NzbDrone.Common.TPL;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.ImportLists
@ -40,7 +41,10 @@ namespace NzbDrone.Core.ImportLists
_logger.Debug("Available import lists {0}", importLists.Count);
Parallel.ForEach(importLists, new ParallelOptions { MaxDegreeOfParallelism = 5 }, importList =>
var taskList = new List<Task>();
var taskFactory = new TaskFactory(TaskCreationOptions.LongRunning, TaskContinuationOptions.None);
foreach (var importList in importLists)
{
var importListLocal = importList;
var importListStatus = _importListStatusService.GetLastSyncListInfo(importListLocal.Definition.Id);
@ -52,10 +56,12 @@ namespace NzbDrone.Core.ImportLists
if (DateTime.UtcNow < importListNextSync)
{
_logger.Trace("Skipping refresh of Import List {0} ({1}) due to minimum refresh interval. Next sync after {2}", importList.Name, importListLocal.Definition.Name, importListNextSync);
return;
continue;
}
}
var task = taskFactory.StartNew(() =>
{
try
{
var importListReports = importListLocal.Fetch();
@ -73,7 +79,12 @@ namespace NzbDrone.Core.ImportLists
{
_logger.Error(e, "Error during Import List Sync of {0} ({1})", importList.Name, importListLocal.Definition.Name);
}
});
}).LogExceptions();
taskList.Add(task);
}
Task.WaitAll(taskList.ToArray());
result = result.DistinctBy(r => new { r.Author, r.Book }).ToList();
@ -94,8 +105,13 @@ namespace NzbDrone.Core.ImportLists
return result;
}
var taskList = new List<Task>();
var taskFactory = new TaskFactory(TaskCreationOptions.LongRunning, TaskContinuationOptions.None);
var importListLocal = importList;
var task = taskFactory.StartNew(() =>
{
try
{
var importListReports = importListLocal.Fetch();
@ -113,6 +129,11 @@ namespace NzbDrone.Core.ImportLists
{
_logger.Error(e, "Error during Import List Sync of {0} ({1})", importList.Name, importListLocal.Definition.Name);
}
}).LogExceptions();
taskList.Add(task);
Task.WaitAll(taskList.ToArray());
result = result.DistinctBy(r => new { r.Author, r.Book }).ToList();

Loading…
Cancel
Save