在springboot中已经集成了定时任务,只需要在启动类上加注解@EnableScheduling即可

例如:

 

 添加类加上@Component注解,添加方法加上@Scheduler即可

posted on 2020-01-19 15:51  song.yan  阅读(200)  评论(0)    收藏  举报