Springboot quartz定时调度

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_32521313/article/details/88237675

只需要在方法上加入@Scheduled注解

@Scheduled(cron = "0 */1 * * * ?")
public void job() throws JobExecutionException {


}

然后在Application中加入// @EnableScheduling注解

@EnableAutoConfiguration
// @EnableScheduling
@SpringBootApplication
public class OWSAppliction {
	public static void main(String[] args) throws Exception {
		SpringApplication.run(OWSAppliction.class);
	}

}

猜你喜欢

转载自blog.csdn.net/qq_32521313/article/details/88237675