updated CommandExecutedEvent to be handled sync.

This commit is contained in:
kay.one
2013-09-16 21:52:02 -07:00
parent eb7dda0629
commit 48c06de098
6 changed files with 12 additions and 16 deletions
@@ -6,7 +6,6 @@ using NLog.Targets;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Configuration.Events;
using NzbDrone.Core.Lifecycle;
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Instrumentation
-1
View File
@@ -3,7 +3,6 @@ using System.Threading;
using System.Threading.Tasks;
using NLog;
using NzbDrone.Core.Lifecycle;
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Messaging.Events;
using Timer = System.Timers.Timer;
+3 -4
View File
@@ -9,7 +9,6 @@ using NzbDrone.Core.Indexers;
using NzbDrone.Core.Instrumentation.Commands;
using NzbDrone.Core.Lifecycle;
using NzbDrone.Core.MediaFiles.Commands;
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Commands.Tracking;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Providers;
@@ -23,7 +22,7 @@ namespace NzbDrone.Core.Jobs
IList<ScheduledTask> GetPending();
}
public class TaskManager : ITaskManager, IHandle<ApplicationStartedEvent>, IHandleAsync<CommandExecutedEvent>, IHandleAsync<ConfigSavedEvent>
public class TaskManager : ITaskManager, IHandle<ApplicationStartedEvent>, IHandle<CommandExecutedEvent>, IHandleAsync<ConfigSavedEvent>
{
private readonly IScheduledTaskRepository _scheduledTaskRepository;
private readonly IConfigService _configService;
@@ -79,7 +78,7 @@ namespace NzbDrone.Core.Jobs
}
}
public void HandleAsync(CommandExecutedEvent message)
public void Handle(CommandExecutedEvent message)
{
var scheduledTask = _scheduledTaskRepository.All().SingleOrDefault(c => c.TypeName == message.Command.GetType().FullName);
@@ -97,4 +96,4 @@ namespace NzbDrone.Core.Jobs
_scheduledTaskRepository.Update(rss);
}
}
}
}