springboot 定时任务

  1. 启动类注解@EnableScheduling
@SpringBootApplication
@EnableScheduling
public class Application {
	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
}
  1. 定时任务方法注解@Scheduled
@Scheduled(cron="0 0/10 * * * ?")
	public void updateState() {
		//TODO 
	}

你可能感兴趣的:(point)