Skip to content

Commit

Permalink
Merge pull request #16 from shoukai/master
Browse files Browse the repository at this point in the history
SpringJobScheduler报already been defined问题
  • Loading branch information
yinjihuan authored Jan 17, 2019
2 parents 133ab79 + 3c55cb1 commit 7ce2dac
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public void setApplicationContext(ApplicationContext ctx) throws BeansException

factory.addConstructorArgValue(elasticJobListeners);
DefaultListableBeanFactory defaultListableBeanFactory = (DefaultListableBeanFactory)ctx.getAutowireCapableBeanFactory();
defaultListableBeanFactory.registerBeanDefinition("SpringJobScheduler", factory.getBeanDefinition());
SpringJobScheduler springJobScheduler = (SpringJobScheduler) ctx.getBean("SpringJobScheduler");
defaultListableBeanFactory.registerBeanDefinition(jobName+"SpringJobScheduler", factory.getBeanDefinition());
SpringJobScheduler springJobScheduler = (SpringJobScheduler) ctx.getBean(jobName+"SpringJobScheduler");
springJobScheduler.init();
logger.info("【" + jobName + "】\t" + jobClass + "\tinit success");
}
Expand Down

0 comments on commit 7ce2dac

Please sign in to comment.