/// <summary> /// 设置重复执行次数 /// </summary> private void SetRepeatCount(SimpleScheduleBuilder builder, JobBase job) { if (job.GetRepeatCount() == null) { builder.RepeatForever(); return; } builder.WithRepeatCount(job.GetRepeatCount().SafeValue()); }
public void ConfigureMessage(SimpleScheduleBuilder scheduleBuilder) { scheduleBuilder.WithIntervalInSeconds((int) _scheduleMeRepetitive.RepetitionInterval.TotalSeconds); if(_scheduleMeRepetitive.NumberOfRepetitions >= 0) scheduleBuilder.WithRepeatCount(_scheduleMeRepetitive.NumberOfRepetitions); if(_scheduleMeRepetitive.NumberOfRepetitions < 0) scheduleBuilder.RepeatForever(); }
private void SetSimpleRepeatCount(JobConfig jobConfig, SimpleScheduleBuilder simpleScheduleBuilder) { if (jobConfig.ExecCount.HasValue) { simpleScheduleBuilder.WithRepeatCount(jobConfig.ExecCount.Value); } else { simpleScheduleBuilder.RepeatForever(); } }
private static SimpleScheduleBuilder Repeat(this SimpleScheduleBuilder builder, int?repeatCount) { return(repeatCount.HasValue ? builder.WithRepeatCount(repeatCount.Value) : builder.RepeatForever()); }