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); }); } } }); } }
public void TestMethod3() { using (ILoggingOperation op = LogManager.GetLogger("Test3").NormalOperation()) { op.SinkWrap(() => { Assert.IsTrue(true); throw new Exception("xy"); }); } Assert.IsTrue(true); }