Example #1
0
        public static bool ScheduleJobs(this IScheduler scheduler, List <JobInfo> jobInfoList = null)
        {
            Ensure.Requires <ArgumentNullException>(scheduler != null, "sheduler should not be null.");
            if (jobInfoList == null)
            {
                jobInfoList = JobOperator.GetJobInfoList();
            }
            var result = false;

            foreach (var jobInfo in jobInfoList)
            {
                result |= ScheduleJob(scheduler, jobInfo);
            }
            return(result);
        }
Example #2
0
        public static async Task <bool> PauseJobsAsync(this IScheduler scheduler, List <JobInfo> jobInfos = null, bool isUpdateDB = false)
        {
            Ensure.Requires <ArgumentNullException>(scheduler != null, "sheduler should not be null.");
            if (jobInfos == null)
            {
                jobInfos = await JobOperator.GetJobInfoListAsync();
            }
            var result = false;

            foreach (var jobInfo in jobInfos)
            {
                result |= PauseJob(scheduler, jobInfo, isUpdateDB);
            }
            return(result);
        }