Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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
            });
        }
Пример #4
0
        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);
        }
Пример #5
0
 public ScheduledJob Get(Guid instanceId)
 {
     return(_repo.Get(instanceId));
 }