Esempio n. 1
0
        private static JobManager CreateJobWorkersManager()
        {
            var jobs = new IJob[]
            {

            };
            //var coordinator = new SingleServerJobCoordinator();
            var coordinator = new SingleServerJobCoordinator();
            //new WebFarmJobCoordinator(new )
            var manager = new JobManager(jobs, coordinator);
            //manager.Fail(ex => );
            return manager;
        }
Esempio n. 2
0
        private static JobManager CreateJobWorkersManager()
        {
            var start = DateTime.Parse("2015-06-23 15:10:00");
            var expire = start.AddYears(2);
            var interval = start.FromMonths(1);

            IJob timedJob = new TimedJob(interval, TimeSpan.MaxValue, start, expire),
                insertJob = new InsertJob(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(50)),
                updateJob = new UpdateJob(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(50));
            var jobs = new[] { insertJob, updateJob, timedJob };
            //new WebFarmJobCoordinator(new )
            var manager = new JobManager(jobs,
                s => FileHelper.WriteFile("FilePath".Config(string.Empty), s));
            manager.Fail(FileHelper.WriteException);
            manager.RestartSchedulerOnFailure = true;
            return manager;
        }