@Scheduled 定时任务注解不能运行
定时任务类
上加
@Component 注解
定时任务方法上加
@Scheduled(cron = "0/20 * * * * ?") 注解
但是定时任务不能调起
经过测试还需要在spring boot 启动类上加
@EnableScheduling 注解
才启动成功
定时任务类
上加
@Component 注解
定时任务方法上加
@Scheduled(cron = "0/20 * * * * ?") 注解
但是定时任务不能调起
经过测试还需要在spring boot 启动类上加
@EnableScheduling 注解
才启动成功