1、properties文件中增加配置項:
datasync.cron=0 */10 * * * ?
2、定時任務類增加PropertySource注解:
@PropertySource("classpath:/xxxx.properties")
3、定時任務方法的Shedule注解改為:
@Scheduled(cron = "${datasync.cron}")
1、properties文件中增加配置項:
datasync.cron=0 */10 * * * ?
2、定時任務類增加PropertySource注解:
@PropertySource("classpath:/xxxx.properties")
3、定時任務方法的Shedule注解改為:
@Scheduled(cron = "${datasync.cron}")
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。