@Component
public class Scheduled {
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
@Scheduled(cron = "0 0/30 * * * ? ") //每隔30分钟执行一次
public void timerRate() {
System.out.println(dateFormat.format(new Date()));
//编写 需要定时执行的业务就OK了
aaa(User);
}
}
定时任务
猜你喜欢
转载自www.cnblogs.com/zongheng14/p/9008544.html
今日推荐
周排行