mirror of
https://github.com/Radarr/Radarr
synced 2026-05-08 13:20:25 +02:00
Don't block task queue for queued update task when there are longer running tasks
Fixes #7538 Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
b2c1698097
commit
41f10d098e
4 changed files with 11 additions and 1 deletions
|
|
@ -5,5 +5,7 @@ namespace NzbDrone.Core.Download
|
||||||
public class ProcessMonitoredDownloadsCommand : Command
|
public class ProcessMonitoredDownloadsCommand : Command
|
||||||
{
|
{
|
||||||
public override bool RequiresDiskAccess => true;
|
public override bool RequiresDiskAccess => true;
|
||||||
|
|
||||||
|
public override bool IsLongRunning => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
using NzbDrone.Core.Messaging.Commands;
|
using NzbDrone.Core.Messaging.Commands;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Indexers
|
namespace NzbDrone.Core.Indexers
|
||||||
{
|
{
|
||||||
public class RssSyncCommand : Command
|
public class RssSyncCommand : Command
|
||||||
{
|
{
|
||||||
public override bool SendUpdatesToClient => true;
|
public override bool SendUpdatesToClient => true;
|
||||||
|
|
||||||
|
public override bool IsLongRunning => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ public virtual bool SendUpdatesToClient
|
||||||
public virtual bool RequiresDiskAccess => false;
|
public virtual bool RequiresDiskAccess => false;
|
||||||
public virtual bool IsExclusive => false;
|
public virtual bool IsExclusive => false;
|
||||||
public virtual bool IsTypeExclusive => false;
|
public virtual bool IsTypeExclusive => false;
|
||||||
|
public virtual bool IsLongRunning => false;
|
||||||
|
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
public DateTime? LastExecutionTime { get; set; }
|
public DateTime? LastExecutionTime { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,11 @@ public bool TryGet(out CommandModel item)
|
||||||
queuedCommands = queuedCommands.Where(c => !exclusiveTypes.Any(x => x == c.Body.Name));
|
queuedCommands = queuedCommands.Where(c => !exclusiveTypes.Any(x => x == c.Body.Name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (startedCommands.Any(x => x.Body.IsLongRunning))
|
||||||
|
{
|
||||||
|
queuedCommands = queuedCommands.Where(c => !c.Body.IsExclusive);
|
||||||
|
}
|
||||||
|
|
||||||
var localItem = queuedCommands.OrderByDescending(c => c.Priority)
|
var localItem = queuedCommands.OrderByDescending(c => c.Priority)
|
||||||
.ThenBy(c => c.QueuedAt)
|
.ThenBy(c => c.QueuedAt)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue