Пример #1
0
 private void ExecuteScheduleJob(ScheduleItem <Job> jobinfo)
 {
     try
     {
         var job = JobContainer.GetJob(jobinfo.Item.JobName);
         if (job == null)
         {
             AddJobLog(jobinfo.Item.JobName, null, false, DateTime.Now, jobinfo.Item.WebSiteId, "job not found, name: " + jobinfo.Item.JobName);
         }
         else
         {
             job.Execute(jobinfo.Item.WebSiteId, jobinfo.Item.Config);
             AddJobLog(jobinfo.Item.JobName, jobinfo.Item.Description, true, DateTime.Now, jobinfo.Item.WebSiteId, "");
         }
     }
     catch (Exception ex)
     {
         AddJobLog(jobinfo.Item.JobName, jobinfo.Item.Description, false, DateTime.Now, jobinfo.Item.WebSiteId, ex.Message);
     }
 }
Пример #2
0
 private void ExecuteRepeatingJob(RepeatItem <Job> repeatingJob)
 {
     if (repeatingJob != null && repeatingJob.Item != null)
     {
         try
         {
             var job = JobContainer.GetJob(repeatingJob.Item.JobName);
             if (job == null)
             {
                 AddJobLog(repeatingJob.Item.JobName, null, false, DateTime.Now, repeatingJob.Item.WebSiteId, "job not found, name: " + repeatingJob.Item.JobName);
             }
             else
             {
                 job.Execute(repeatingJob.Item.WebSiteId, repeatingJob.Item.Config);
                 AddJobLog(repeatingJob.Item.JobName, repeatingJob.Item.Description, true, DateTime.Now, repeatingJob.Item.WebSiteId, "");
             }
         }
         catch (Exception ex)
         {
             AddJobLog(repeatingJob.Item.JobName, repeatingJob.Item.Description, false, DateTime.Now, repeatingJob.Item.WebSiteId, ex.Message);
         }
     }
 }