Exemplo n.º 1
0
 /// <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();
        }
Exemplo n.º 3
0
 private void SetSimpleRepeatCount(JobConfig jobConfig, SimpleScheduleBuilder simpleScheduleBuilder)
 {
     if (jobConfig.ExecCount.HasValue)
     {
         simpleScheduleBuilder.WithRepeatCount(jobConfig.ExecCount.Value);
     }
     else
     {
         simpleScheduleBuilder.RepeatForever();
     }
 }
Exemplo n.º 4
0
 private static SimpleScheduleBuilder Repeat(this SimpleScheduleBuilder builder, int?repeatCount)
 {
     return(repeatCount.HasValue ? builder.WithRepeatCount(repeatCount.Value)
         : builder.RepeatForever());
 }