コード例 #1
0
        public void ResumeJobs(IEnumerable <string> jobIdList)
        {
            using (ILoggingOperation log = _logger.NormalOperation())
            {
                log.Wrap(() =>
                {
                    List <JobDetail> result = new List <JobDetail>();

                    foreach (JobKey item in Global.Scheduler.GetJobKeys(GroupMatcher <JobKey> .GroupEquals(ServiceConstants.JobGroupName))
                             .Where(p => jobIdList.Contains(p.Name))
                             )
                    {
                        using (ILoggingOperation tmpLog = log.NormalOperation()
                                                          .AddProperty("jobId", item.Name))
                        {
                            tmpLog.SinkWrap(() =>
                            {
                                ITrigger trigger = Global.Scheduler.GetTriggersOfJob(item).First(p => p.Key.Group == ServiceConstants.TriggerGroupName && Global.Scheduler.GetTriggerState(p.Key) == TriggerState.Paused);

                                Global.Scheduler.RescheduleJob(trigger.Key, (ITrigger)trigger.Clone());
                                //Global.Scheduler.ResumeJob(item);
                            });
                        }
                    }
                });
            }
        }
コード例 #2
0
 public void TestMethod3()
 {
     using (ILoggingOperation op = LogManager.GetLogger("Test3").NormalOperation())
     {
         op.SinkWrap(() =>
         {
             Assert.IsTrue(true);
             throw new Exception("xy");
         });
     }
     Assert.IsTrue(true);
 }