摘要: SpringBoot使用@Scheduled实现定时任务 SpringBoot 实现定时任务很简单,只需要使用@Scheduled注解即可,但是该注解是实现的定时任务默认是单线程的,也就意味着多个定时任务执行时就可能导致线程堵塞,延缓定时任务的执行。所以在需要的时候,我们可以设置一个线程池去执行定时任务。 在启动类上加入@EnableScheduling注 阅读全文
posted @ 2023-08-07 11:17 残城碎梦 阅读(222) 评论(0) 推荐(0) 编辑