spring定时任务

来源:互联网 发布:nba常规赛球员数据 编辑:程序博客网 时间:2024/05/21 10:33
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;


@Configuration
@EnableScheduling
public class TimeSendEmail {


// @Scheduled(cron = "0 0 8 1 * ?") // 每月1号的8点触发
// @Scheduled(cron = "0/5 * *  * * ? ") // 每5秒触发一次
// @Scheduled(cron = "0 0 8 * * ?") // 每天上午8点触发
@Scheduled(cron = "0 0 8 ? * MON") // 每周一八点触发一次
public void Scheduled(){
SendEmail.queryNurse();
}

}
0 0
原创粉丝点击