public static void Config(string url = null) { Logger.Debug("Aphid.TaskJob.Config Config()"); try { _scheduler = StdSchedulerFactory.GetDefaultScheduler(); _scheduler.Start(); if (!string.IsNullOrEmpty(url)) { IJobDetail job1 = JobBuilder.Create<KeepAliveJob>().WithIdentity("aliveJob", "alivejobgroup") .UsingJobData("url", url) .Build(); ITrigger trigger1 = TriggerBuilder.Create()//.WithIdentity("aliveTrigger", "aliveTriggergroup") .WithSimpleSchedule(x => x.WithIntervalInMinutes(5).RepeatForever()).StartNow() .Build(); _scheduler.ScheduleJob(job1, trigger1); } IJobDetail job = JobBuilder.Create<ErpCustomerExtractJob>().WithIdentity("customerDataJob", "extractdatajobgroup").Build(); ITrigger trigger = TriggerBuilder.Create()//.WithIdentity("customerDataTrigger", "extractdataTriggergroup") .WithSimpleSchedule(x => x.WithIntervalInMinutes(20).RepeatForever()).StartNow().Build(); _scheduler.ScheduleJob(job, trigger); } catch (Exception ex) { Logger.Error(ex); } }
customerDataJob 这个任务没有执行。aliveJob 任务执行了。
求大神指点。
楼主找到解决方案了没?
这么多年了,我只记得好像 是配置错误,url 为空