1.在入口类中加入注解 @EnableScheduling
springboot使用@EnableScheduling注解进行定时任务
2.在具体方法中加注解@scheduled,并设定定时时间fixedDelay
springboot使用@EnableScheduling注解进行定时任务
这只是简单的使用

这是复杂写法: @Scheduled(cron = “0 0 2 * * ?”)  //每天凌晨两点执行
关键字 cron

相关文章:

  • 2021-09-16
  • 2021-05-22
  • 2021-07-19
  • 2022-12-23
  • 2021-05-05
  • 2021-07-25
  • 2022-03-09
  • 2022-12-23
猜你喜欢
  • 2022-01-10
  • 2021-07-05
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案