今天偶然发现springboot的@Schedule定时任务不执行, 因为这个bean是被默认延迟加载的.
不多说, 最终加上关闭懒加载搞定.
@Lazy(false)
@PostConstruct
@Scheduled(fixedRate = 60 * 1000)
public void refreshL2Cache() {
....
}
今天偶然发现springboot的@Schedule定时任务不执行, 因为这个bean是被默认延迟加载的.
不多说, 最终加上关闭懒加载搞定.
@Lazy(false)
@PostConstruct
@Scheduled(fixedRate = 60 * 1000)
public void refreshL2Cache() {
....
}