1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-17 15:02:34 +02:00

Fixed timing issue allowing multiple instances of the same command to be queued

This commit is contained in:
Taloth Saldono 2020-05-03 16:33:52 +02:00 committed by Qstick
parent cc283f64a3
commit 8d2d19d17b

View File

@ -100,8 +100,10 @@ public CommandModel Push<TCommand>(TCommand command, CommandPriority priority =
_logger.Trace("Publishing {0}", command.Name);
_logger.Trace("Checking if command is queued or started: {0}", command.Name);
lock (_commandQueue)
{
var existingCommands = QueuedOrStarted(command.Name);
var existing = existingCommands.SingleOrDefault(c => CommandEqualityComparer.Instance.Equals(c.Body, command));
var existing = existingCommands.FirstOrDefault(c => CommandEqualityComparer.Instance.Equals(c.Body, command));
if (existing != null)
{
@ -127,6 +129,7 @@ public CommandModel Push<TCommand>(TCommand command, CommandPriority priority =
return commandModel;
}
}
public CommandModel Push(string commandName, DateTime? lastExecutionTime, DateTime? lastStartTime, CommandPriority priority = CommandPriority.Normal, CommandTrigger trigger = CommandTrigger.Unspecified)
{