2012-01-26 04:29:55 +03:00
|
|
|
using System;
|
|
|
|
using System.Linq;
|
|
|
|
using Ninject;
|
2012-02-13 10:49:53 +03:00
|
|
|
using NzbDrone.Common;
|
2012-01-26 04:29:55 +03:00
|
|
|
using NzbDrone.Core.Model.Notification;
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Jobs
|
|
|
|
{
|
|
|
|
public class CheckpointJob : IJob
|
|
|
|
{
|
|
|
|
private readonly AnalyticsProvider _analyticsProvider;
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
public CheckpointJob(AnalyticsProvider analyticsProvider)
|
|
|
|
{
|
|
|
|
_analyticsProvider = analyticsProvider;
|
|
|
|
}
|
|
|
|
|
|
|
|
public CheckpointJob()
|
|
|
|
{
|
2012-02-15 05:20:32 +03:00
|
|
|
|
2012-01-26 04:29:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
get { return "Checkpoint Job"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public TimeSpan DefaultInterval
|
|
|
|
{
|
|
|
|
get { return TimeSpan.FromDays(1); }
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Start(ProgressNotification notification, int targetId, int secondaryTargetId)
|
|
|
|
{
|
2012-02-15 05:20:32 +03:00
|
|
|
_analyticsProvider.Checkpoint();
|
2012-01-26 04:29:55 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|