diff --git a/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs b/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs index fd030ffea..26725a2c9 100644 --- a/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs +++ b/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; using NLog; +using NzbDrone.Core.Lifecycle; using NzbDrone.Core.Messaging.Commands; +using NzbDrone.Core.Messaging.Events; namespace NzbDrone.Core.Housekeeping { - public class HousekeepingService : IExecute + public class HousekeepingService : IExecute, IHandleAsync { private readonly IEnumerable _housekeepers; private readonly Logger _logger; @@ -16,7 +18,7 @@ namespace NzbDrone.Core.Housekeeping _logger = logger; } - public void Execute(HousekeepingCommand message) + private void Clean() { _logger.Info("Running housecleaning tasks"); @@ -32,5 +34,15 @@ namespace NzbDrone.Core.Housekeeping } } } + + public void Execute(HousekeepingCommand message) + { + Clean(); + } + + public void HandleAsync(ApplicationStartedEvent message) + { + Clean(); + } } }