spring-boot 定时任务

spring-boot 定时任务

配置

@Configuration
@EnableScheduling
public class SchedulingConfig {
	
	@Scheduled(cron = "0/20 * * * * ?") // 每20秒执行一次
	public void scheduler() {
	    System.out.println(">>>>>>>>> SchedulingConfig.scheduler()");
	}
}

猜你喜欢

转载自my.oschina.net/u/159221/blog/1621983