package com.scheduled;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@EnableScheduling
@Configuration
public class TestTask {
@Scheduled(cron = "0/3 * * * * ? ") // 心跳 每间隔两秒执行一次
public void task() {
System.out.println("11111111111111111111111111111");
}
}
springboot + scheduled
猜你喜欢
转载自blog.csdn.net/yuell102/article/details/109826250
今日推荐
周排行