back to tiny for now

This commit is contained in:
Keivan Beigi 2013-05-10 16:53:50 -07:00 committed by kay.one
commit 4deecde092
84 changed files with 617 additions and 558 deletions

View file

@ -10,6 +10,7 @@ namespace NzbDrone.Core.Jobs
{
IList<ScheduledTask> GetPendingJobs();
ScheduledTask GetDefinition(Type type);
void SetLastExecutionTime(int id, DateTime executionTime);
}
@ -23,7 +24,7 @@ namespace NzbDrone.Core.Jobs
public ScheduledTask GetDefinition(Type type)
{
return Query.Single(c => c.Name == type.FullName);
return Query.Single(c => c.TypeName == type.FullName);
}
@ -31,5 +32,16 @@ namespace NzbDrone.Core.Jobs
{
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
{
Id = id,
LastExecution = executionTime
};
SetFields(task, scheduledTask => scheduledTask.LastExecution);
}
}
}