diff --git a/elastic-job-springboot-core/src/main/java/com/example/serive/impl/JobServiceImpl.java b/elastic-job-springboot-core/src/main/java/com/example/serive/impl/JobServiceImpl.java index 9045a8c..edc2c56 100644 --- a/elastic-job-springboot-core/src/main/java/com/example/serive/impl/JobServiceImpl.java +++ b/elastic-job-springboot-core/src/main/java/com/example/serive/impl/JobServiceImpl.java @@ -66,15 +66,14 @@ public class JobServiceImpl implements JobService { try { Class aClass = Class.forName(job.getJobClass()); SimpleJob simpleJob = (SimpleJob) ctx.getBean(aClass); - new SpringJobScheduler(simpleJob, center, ljc).init(); // 配置数据源 // if (job.isJobEvent()) { // JobEventConfiguration jec = new JobEventRdbConfiguration(dataSource); -// new SpringJobScheduler(elasticJob, center, ljc, jec); +// new SpringJobScheduler(elasticJob, center, ljc, jec).init(); // } else { -// new SpringJobScheduler(elasticJob, center, ljc); +// new SpringJobScheduler(elasticJob, center, ljc).init(); // } - new SpringJobScheduler(simpleJob, center, ljc); + new SpringJobScheduler(simpleJob, center, ljc).init(); } catch (Exception e) { e.printStackTrace(); log.error("加载任务失败,任务为 {}", job.getJobName());