|
|
|
@ -8,7 +8,6 @@ namespace NzbDrone.Core.Jobs
|
|
|
|
|
{
|
|
|
|
|
public interface IScheduledTaskRepository : IBasicRepository<ScheduledTask>
|
|
|
|
|
{
|
|
|
|
|
IList<ScheduledTask> GetPendingJobs();
|
|
|
|
|
ScheduledTask GetDefinition(Type type);
|
|
|
|
|
void SetLastExecutionTime(int id, DateTime executionTime);
|
|
|
|
|
}
|
|
|
|
@ -27,12 +26,6 @@ namespace NzbDrone.Core.Jobs
|
|
|
|
|
return Query.Single(c => c.TypeName == type.FullName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IList<ScheduledTask> GetPendingJobs()
|
|
|
|
|
{
|
|
|
|
|
return Query.Where(c => c.Interval != 0).ToList().Where(c => c.LastExecution < DateTime.Now.AddMinutes(-c.Interval)).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetLastExecutionTime(int id, DateTime executionTime)
|
|
|
|
|
{
|
|
|
|
|
var task = new ScheduledTask
|
|
|
|
|