public DateTime JobLastRunTime <T>() where T : ScheduledJobBase { var job = _scheduledJobRepo.Get("Execute", typeof(T).FullName, typeof(T).Assembly.GetName().Name); if (job.IsRunning) { return(DateTime.MaxValue); } return(job.LastExecution); }
public DateTime VGJobLastRunTime() { var job = _scheduledJobRepo.Get("Execute", "N1990.Episerver.Cms.Audit.Business.VisitorGroupAudit", "N1990.Episerver.Cms.Audit"); if (job.IsRunning) { return(DateTime.MaxValue); } return(job.LastExecution); }
private static void RunIndexJob(IScheduledJobExecutor scheduledJobExecutor, IScheduledJobRepository scheduledJobRepository, Guid jobId) { var job = scheduledJobRepository.Get(jobId); if (job == null) { return; } scheduledJobExecutor.StartAsync(job, new JobExecutionOptions { Trigger = ScheduledJobTrigger.User }); }
public static ScheduledJob GetJobDefinition() { #if CMS9 ScheduledJobRepository repository = ServiceLocator.Current.GetInstance <ScheduledJobRepository>(); #else IScheduledJobRepository repository = ServiceLocator.Current.GetInstance <IScheduledJobRepository>(); #endif ScheduledJob job = repository.Get("Execute", typeof(SendNewsLetterTask).FullName, typeof(SendNewsLetterTask).Assembly.GetName().Name); return(job); }
public ScheduledJob Get(Guid instanceId) { return(_repo.Get(instanceId)); }