Command queue

New: Adding multiple series will queue them instead of running all at once
New: Slower scheduled tasks won't be block others from running
This commit is contained in:
Mark McDowall
2015-01-15 16:30:09 -08:00
parent 446d470f53
commit 638e3ca898
66 changed files with 1151 additions and 636 deletions
+2 -7
View File
@@ -15,7 +15,7 @@ using NzbDrone.Core.Tv.Events;
namespace NzbDrone.Core.Tv
{
public class RefreshSeriesService : IExecute<RefreshSeriesCommand>, IHandleAsync<SeriesAddedEvent>
public class RefreshSeriesService : IExecute<RefreshSeriesCommand>
{
private readonly IProvideSeriesInfo _seriesInfo;
private readonly ISeriesService _seriesService;
@@ -138,7 +138,7 @@ namespace NzbDrone.Core.Tv
foreach (var series in allSeries)
{
if (message.Manual || _checkIfSeriesShouldBeRefreshed.ShouldRefresh(series))
if (message.Trigger == CommandTrigger.Manual || _checkIfSeriesShouldBeRefreshed.ShouldRefresh(series))
{
try
{
@@ -165,10 +165,5 @@ namespace NzbDrone.Core.Tv
}
}
}
public void HandleAsync(SeriesAddedEvent message)
{
RefreshSeriesInfo(message.Series);
}
}
}