mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
improvements to scheduler,
better parallelism on RSS fetch
This commit is contained in:
parent
ff225e1753
commit
a816a83f3a
12 changed files with 114 additions and 29 deletions
|
@ -33,29 +33,32 @@ namespace NzbDrone.Core.Jobs
|
|||
|
||||
private void ExecuteCommands()
|
||||
{
|
||||
var tasks = _taskManager.GetPending();
|
||||
|
||||
_logger.Trace("Pending Tasks: {0}", tasks.Count);
|
||||
|
||||
foreach (var task in tasks)
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
var commandType = Type.GetType(task.TypeName);
|
||||
var command = (ICommand)Activator.CreateInstance(commandType);
|
||||
Timer.Enabled = false;
|
||||
|
||||
_messageAggregator.PublishCommand(command);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.ErrorException("Error occurred while execution task " + task.TypeName, e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_taskManager.SetLastExecutionTime(task.Id);
|
||||
}
|
||||
var tasks = _taskManager.GetPending();
|
||||
|
||||
_logger.Trace("Pending Tasks: {0}", tasks.Count);
|
||||
|
||||
foreach (var task in tasks)
|
||||
{
|
||||
try
|
||||
{
|
||||
var commandType = Type.GetType(task.TypeName);
|
||||
var command = (ICommand)Activator.CreateInstance(commandType);
|
||||
|
||||
_messageAggregator.PublishCommand(command);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.ErrorException("Error occurred while execution task " + task.TypeName, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Timer.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue