コード例 #1
0
        /// <summary>
        ///     设置调度策略
        /// </summary>
        private void Schedule(SimpleScheduleBuilder builder, JobBase job)
        {
            SetRepeatCount(builder, job);
            // 默认30分钟
            builder.WithIntervalInMinutes(30);
            if (job.GetInterval() != null)
            {
                builder.WithInterval(job.GetInterval().SafeValue());
            }

            if (job.GetIntervalInHours() != null)
            {
                builder.WithIntervalInHours(job.GetIntervalInHours().SafeValue());
            }

            if (job.GetIntervalInMinutes() != null)
            {
                builder.WithIntervalInMinutes(job.GetIntervalInMinutes().SafeValue());
            }

            if (job.GetIntervalInSeconds() != null)
            {
                builder.WithIntervalInSeconds(job.GetIntervalInSeconds().SafeValue());
            }
        }