update sync task

This commit is contained in:
Luke Pulverenti
2016-03-20 23:04:44 -04:00
parent 63fe0239e3
commit 52a42229cd
6 changed files with 41 additions and 13 deletions

View File

@@ -170,6 +170,17 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks
QueueScheduledTask<T>(new TaskExecutionOptions());
}
public void QueueIfNotRunning<T>()
where T : IScheduledTask
{
var task = ScheduledTasks.First(t => t.ScheduledTask.GetType() == typeof(T));
if (task.State != TaskState.Running)
{
QueueScheduledTask<T>(new TaskExecutionOptions());
}
}
public void Execute<T>()
where T : IScheduledTask
{