ScheduledTasks properly set last run time now

This commit is contained in:
Mark McDowall 2013-08-30 20:39:05 -07:00
parent c96ba5efd3
commit 1e7db2287e
6 changed files with 16 additions and 16 deletions

View File

@ -20,17 +20,17 @@ namespace NzbDrone.Api.Commands
public void HandleAsync(CommandStartedEvent message)
{
BroadcastMessage(message.Command);
BroadcastMessage(message.TrackedCommand);
}
public void HandleAsync(CommandCompletedEvent message)
{
BroadcastMessage(message.Command);
BroadcastMessage(message.TrackedCommand);
}
public void Handle(CommandFailedEvent message)
{
BroadcastMessage(message.Command);
BroadcastMessage(message.TrackedCommand);
}
private void BroadcastMessage(TrackedCommand trackedCommand)

View File

@ -4,11 +4,11 @@ namespace NzbDrone.Common.Messaging.Events
{
public class CommandCompletedEvent : IEvent
{
public TrackedCommand Command { get; private set; }
public TrackedCommand TrackedCommand { get; private set; }
public CommandCompletedEvent(TrackedCommand command)
public CommandCompletedEvent(TrackedCommand trackedCommand)
{
Command = command;
TrackedCommand = trackedCommand;
}
}
}

View File

@ -4,11 +4,11 @@ namespace NzbDrone.Common.Messaging.Events
{
public class CommandExecutedEvent : IEvent
{
public TrackedCommand Command { get; private set; }
public TrackedCommand TrackedCommand { get; private set; }
public CommandExecutedEvent(TrackedCommand command)
public CommandExecutedEvent(TrackedCommand trackedCommand)
{
Command = command;
TrackedCommand = trackedCommand;
}
}
}

View File

@ -5,12 +5,12 @@ namespace NzbDrone.Common.Messaging.Events
{
public class CommandFailedEvent : IEvent
{
public TrackedCommand Command { get; private set; }
public TrackedCommand TrackedCommand { get; private set; }
public Exception Exception { get; private set; }
public CommandFailedEvent(TrackedCommand command, Exception exception)
public CommandFailedEvent(TrackedCommand trackedCommand, Exception exception)
{
Command = command;
TrackedCommand = trackedCommand;
Exception = exception;
}
}

View File

@ -4,11 +4,11 @@ namespace NzbDrone.Common.Messaging.Events
{
public class CommandStartedEvent : IEvent
{
public TrackedCommand Command { get; private set; }
public TrackedCommand TrackedCommand { get; private set; }
public CommandStartedEvent(TrackedCommand command)
public CommandStartedEvent(TrackedCommand trackedCommand)
{
Command = command;
TrackedCommand = trackedCommand;
}
}
}

View File

@ -79,7 +79,7 @@ namespace NzbDrone.Core.Jobs
public void HandleAsync(CommandExecutedEvent message)
{
var scheduledTask = _scheduledTaskRepository.All().SingleOrDefault(c => c.TypeName == message.Command.GetType().FullName);
var scheduledTask = _scheduledTaskRepository.All().SingleOrDefault(c => c.TypeName == message.TrackedCommand.Command.GetType().FullName);
if (scheduledTask != null)
{