Пример #1
0
 /// <summary>
 /// Job完成时调用
 /// </summary>
 /// <param name="trigger">触发器</param>
 /// <param name="context">上下文</param>
 /// <param name="triggerInstructionCode"></param>
 public void TriggerComplete(ITrigger trigger, IJobExecutionContext context, SchedulerInstruction triggerInstructionCode)
 {
     JobHelper.UpdateNextFireTime(trigger.JobKey.Name, TimeZoneInfo.ConvertTimeFromUtc(context.NextFireTimeUtc.Value.DateTime, TimeZoneInfo.Local));
 }
Пример #2
0
 /// <summary>
 ///  //Trigger触发后,job执行时调用本方法。true即否决,job后面不执行。
 /// </summary>
 /// <param name="trigger"></param>
 /// <param name="context"></param>
 /// <returns></returns>
 public bool VetoJobExecution(ITrigger trigger, IJobExecutionContext context)
 {
     JobHelper.UpdateRecentRunTime(trigger.JobKey.Name, TimeZoneInfo.ConvertTimeFromUtc(context.FireTimeUtc.Value.DateTime, TimeZoneInfo.Local));
     return(false);
 }