宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取
1、properties文件中增加配置项:
datasync.cron=0 */10 * * * ?
2、定时任务类增加PropertySource注解:
@PropertySource("classpath:/xxxx.properties")
3、定时任务方法的Shedule注解改为:
@Scheduled(cron = "${datasync.cron}")
宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取
1、properties文件中增加配置项:
datasync.cron=0 */10 * * * ?
2、定时任务类增加PropertySource注解:
@PropertySource("classpath:/xxxx.properties")
3、定时任务方法的Shedule注解改为:
@Scheduled(cron = "${datasync.cron}")
最新评论