package com.kwan.springbootkwan.schedule; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; /** * schedule测试 10s执行一次 记得在启动类或者Configuration类上添加了@EnableScheduling注解。 * * @author : qinyingjie * @version : 2.2.0 * @date : 2022/12/9 13:58 */ @Component @Slf4j public class ScheduleTest { @Scheduled(cron = "0/10 * * * * ?") public void execute() { log.info("Scheduled task is running ... ..."); } }