master
liyuxin 2024-07-22 14:32:33 +07:00
parent 37597634d8
commit ab7b9eea9a
1 changed files with 3 additions and 4 deletions

View File

@ -7,9 +7,8 @@ import org.springframework.stereotype.Service;
public class ScheduledPrintNameService {
// 每隔5秒钟执行一次任务
@Scheduled(fixedRate = 5000)
@Scheduled(cron="0/5 * * * * ? ")
public void printName() {
System.out.println("Scheduled task: Printing name...");
// 可以在这里编写具体的任务逻辑
System.out.println("111111");
}
}