mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Fixed timing issue allowing multiple instances of the same command to be queued
This commit is contained in:
parent
9fdc603fc3
commit
880170637e
1 changed files with 26 additions and 23 deletions
|
@ -100,8 +100,10 @@ namespace NzbDrone.Core.Messaging.Commands
|
|||
_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 @@ namespace NzbDrone.Core.Messaging.Commands
|
|||
|
||||
return commandModel;
|
||||
}
|
||||
}
|
||||
|
||||
public CommandModel Push(string commandName, DateTime? lastExecutionTime, DateTime? lastStartTime, CommandPriority priority = CommandPriority.Normal, CommandTrigger trigger = CommandTrigger.Unspecified)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue