1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

added job time that ticks kicks off scheduler.

This commit is contained in:
kay.one 2013-03-04 21:51:07 -08:00
parent 568d4b8eeb
commit 6c17639ade
18 changed files with 62 additions and 38 deletions

View File

@ -56,7 +56,6 @@ private void KickoffInitilizables(ILifetimeScope container)
try
{
initializable.Init();
}
catch (Exception e)
{

View File

@ -8,7 +8,7 @@
using NzbDrone.Api.Extensions;
using NzbDrone.Common;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Jobs.Framework;
using NzbDrone.Core.Jobs.Implementations;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Model;

View File

@ -5,6 +5,7 @@
using Moq;
using NUnit.Framework;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Jobs.Implementations;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Model;

View File

@ -6,6 +6,7 @@
using FizzWare.NBuilder;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.Jobs.Implementations;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Jobs;

View File

@ -7,7 +7,7 @@
using NCrunch.Framework;
using NUnit.Framework;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Jobs.Framework;
using NzbDrone.Core.Jobs.Implementations;
using NzbDrone.Core.Model;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;

View File

@ -10,7 +10,6 @@
using NUnit.Framework;
using NzbDrone.Common;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Jobs.Framework;
using NzbDrone.Core.Model;
using NzbDrone.Core.Repository;
using NzbDrone.Core.Test.Framework;

View File

@ -9,6 +9,7 @@
using NzbDrone.Common;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Jobs.Implementations;
using NzbDrone.Core.Model;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Test.Framework;

View File

@ -7,6 +7,7 @@
using Moq;
using NUnit.Framework;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Jobs.Implementations;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Model;

View File

@ -5,6 +5,7 @@
using NUnit.Framework;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Jobs.Implementations;
using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Test.Framework;

View File

@ -5,6 +5,7 @@
using FizzWare.NBuilder;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.Jobs.Implementations;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Model;

View File

@ -2,7 +2,6 @@
using System.Linq;
using System.Threading;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Jobs.Framework;
using NzbDrone.Core.Model.Notification;
namespace NzbDrone.Core.Test.JobTests

View File

@ -3,10 +3,8 @@
using System.Linq;
using System.Reflection;
using Autofac;
using Autofac.Core;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Eventing;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.ExternalNotification;
using NzbDrone.Core.Indexers;
@ -15,7 +13,7 @@
namespace NzbDrone.Core
{
public static class ContainerExtentions
public static class ContainerExtensions
{
private static readonly Logger logger = LogManager.GetLogger("ServiceRegistration");

View File

@ -1,7 +1,6 @@
using System;
using System.Linq;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Jobs.Framework;
using NzbDrone.Core.Model.Notification;
namespace NzbDrone.Core.Instrumentation

View File

@ -0,0 +1,26 @@
using System.Timers;
using NzbDrone.Core.Lifecycle;
namespace NzbDrone.Core.Jobs
{
public class JobTimer : IInitializable
{
private readonly IJobController _jobController;
private readonly Timer _timer;
public JobTimer(IJobController jobController)
{
_jobController = jobController;
_timer = new Timer();
}
public void Init()
{
_timer.Interval = 1000 * 30;
_timer.Elapsed += (o, args) => _jobController.EnqueueScheduled();
_timer.Start();
}
}
}

View File

@ -3,7 +3,6 @@
using NLog;
using NzbDrone.Common;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Jobs.Framework;
using NzbDrone.Core.Model.Notification;
namespace NzbDrone.Core.Lifecycle

View File

@ -3,7 +3,6 @@
using NLog;
using NzbDrone.Common;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Jobs.Framework;
using NzbDrone.Core.Model.Notification;
namespace NzbDrone.Core.Lifecycle

View File

@ -5,7 +5,6 @@
using NLog;
using NzbDrone.Common;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Jobs.Framework;
using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers;

View File

@ -183,7 +183,7 @@
<Compile Include="Configuration\ConfigRepository.cs" />
<Compile Include="Configuration\IConfigService.cs" />
<Compile Include="Constants.cs" />
<Compile Include="ContainerExtentions.cs" />
<Compile Include="ContainerExtensions.cs" />
<Compile Include="Datastore\ModelBase.cs" />
<Compile Include="Datastore\BasicRepository.cs" />
<Compile Include="Datastore\ObjectDbFactory.cs" />
@ -204,14 +204,34 @@
<Compile Include="Indexers\NewznabRepository.cs" />
<Compile Include="Instrumentation\LogInjectionModule.cs" />
<Compile Include="Instrumentation\LogRepository.cs" />
<Compile Include="Jobs\CleanupRecycleBinJob.cs" />
<Compile Include="Jobs\Framework\JobRepository.cs" />
<Compile Include="Jobs\IJob.cs" />
<Compile Include="Jobs\Implementations\BacklogSearchJob.cs" />
<Compile Include="Jobs\Implementations\CleanupRecycleBinJob.cs" />
<Compile Include="Jobs\Implementations\ConvertEpisodeJob.cs" />
<Compile Include="Jobs\Implementations\DeleteSeriesJob.cs" />
<Compile Include="Jobs\Implementations\DiskScanJob.cs" />
<Compile Include="Jobs\Implementations\EmptyRecycleBinJob.cs" />
<Compile Include="Jobs\Implementations\EpisodeSearchJob.cs" />
<Compile Include="Jobs\Implementations\ImportNewSeriesJob.cs" />
<Compile Include="Jobs\Implementations\PastWeekBacklogSearchJob.cs" />
<Compile Include="Jobs\Implementations\PostDownloadScanJob.cs" />
<Compile Include="Jobs\Implementations\RecentBacklogSearchJob.cs" />
<Compile Include="Jobs\Implementations\RefreshEpisodeMetadata.cs" />
<Compile Include="Jobs\Implementations\RenameSeasonJob.cs" />
<Compile Include="Jobs\Implementations\RenameSeriesJob.cs" />
<Compile Include="Jobs\Implementations\RssSyncJob.cs" />
<Compile Include="Jobs\Implementations\SeasonSearchJob.cs" />
<Compile Include="Jobs\Implementations\SeriesSearchJob.cs" />
<Compile Include="Jobs\Implementations\UpdateInfoJob.cs" />
<Compile Include="Jobs\Implementations\UpdateSceneMappingsJob.cs" />
<Compile Include="Jobs\Implementations\XemUpdateJob.cs" />
<Compile Include="Jobs\JobController.cs" />
<Compile Include="Jobs\JobDefinition.cs" />
<Compile Include="Jobs\JobQueueItem.cs" />
<Compile Include="Jobs\JobRepository.cs" />
<Compile Include="Jobs\JobTimer.cs" />
<Compile Include="Lifecycle\AppShutdownJob.cs" />
<Compile Include="Lifecycle\AppRestartJob.cs" />
<Compile Include="Jobs\XemUpdateJob.cs" />
<Compile Include="Jobs\EmptyRecycleBinJob.cs" />
<Compile Include="Jobs\RefreshEpsiodeMetadata.cs" />
<Compile Include="Jobs\PastWeekBacklogSearchJob.cs" />
<Compile Include="Lifecycle\IInitializable.cs" />
<Compile Include="MediaCover\MediaCover.cs" />
<Compile Include="MediaFiles\MediaFileRepository.cs" />
@ -234,7 +254,6 @@
<Compile Include="Model\Nzbx\NzbxRecentItem.cs" />
<Compile Include="Model\Nzbx\NzbxVotesModel.cs" />
<Compile Include="Model\PostDownloadStatusType.cs" />
<Compile Include="Jobs\Framework\JobQueueItem.cs" />
<Compile Include="Model\LanguageType.cs" />
<Compile Include="Model\MisnamedEpisodeModel.cs" />
<Compile Include="Qualities\QualitySizeRepository.cs" />
@ -296,28 +315,11 @@
<Compile Include="Providers\Search\EpisodeSearch.cs" />
<Compile Include="Providers\Search\SearchBase.cs" />
<Compile Include="Tv\SeasonService.cs" />
<Compile Include="Jobs\RecentBacklogSearchJob.cs" />
<Compile Include="Instrumentation\TrimLogsJob.cs" />
<Compile Include="Jobs\Framework\JobController.cs" />
<Compile Include="Jobs\RenameSeasonJob.cs" />
<Compile Include="Jobs\RenameSeriesJob.cs" />
<Compile Include="Lifecycle\AppUpdateJob.cs" />
<Compile Include="Jobs\BacklogSearchJob.cs" />
<Compile Include="Jobs\ConvertEpisodeJob.cs" />
<Compile Include="Jobs\SeriesSearchJob.cs" />
<Compile Include="Jobs\SeasonSearchJob.cs" />
<Compile Include="Model\Xbmc\TvShowResponse.cs" />
<Compile Include="Model\Xbmc\TvShow.cs" />
<Compile Include="Model\Xbmc\VersionResult.cs" />
<Compile Include="Jobs\UpdateSceneMappingsJob.cs" />
<Compile Include="Jobs\PostDownloadScanJob.cs" />
<Compile Include="Jobs\EpisodeSearchJob.cs" />
<Compile Include="Jobs\DeleteSeriesJob.cs" />
<Compile Include="Jobs\DiskScanJob.cs" />
<Compile Include="Jobs\ImportNewSeriesJob.cs" />
<Compile Include="Jobs\Framework\IJob.cs" />
<Compile Include="Jobs\RssSyncJob.cs" />
<Compile Include="Jobs\UpdateInfoJob.cs" />
<Compile Include="MetadataSource\TvRageMappingProvider.cs" />
<Compile Include="MetadataSource\TvRageProxy.cs" />
<Compile Include="Providers\XemCommunicationProvider.cs" />
@ -496,7 +498,6 @@
</Compile>
<Compile Include="Indexers\NewznabDefinition.cs" />
<Compile Include="ExternalNotification\ExternalNotificationDefinition.cs" />
<Compile Include="Jobs\Framework\JobDefinition.cs" />
<Compile Include="Indexers\Indexer.cs" />
<Compile Include="Model\EpisodeParseResult.cs" />
<Compile Include="Model\EpisodeSortingType.cs" />