This commit is contained in:
redkale
2023-12-09 11:12:33 +08:00
parent c2f66b61ec
commit 6d9f2ec6be
6 changed files with 44 additions and 15 deletions

View File

@@ -3,9 +3,9 @@
*/
package org.redkale.test.scheduling;
import org.redkale.annotation.Scheduled;
import org.redkale.service.Service;
import org.redkale.util.Times;
import org.redkale.annotation.Scheduling;
/**
*
@@ -13,18 +13,18 @@ import org.redkale.util.Times;
*/
public class ScheduleService implements Service {
@Scheduled(cron = "0/1 * * * * ?")
@Scheduling(cron = "0/1 * * * * ?")
public void task1() {
System.out.println(Times.nowMillis() + "每秒-----------执行task1");
}
@Scheduled(cron = "0/1 * * * * ?")
@Scheduling(cron = "0/1 * * * * ?")
public String task2() {
System.out.println(Times.nowMillis() + "每秒*****执行task2");
return "";
}
@Scheduled(cron = "0/1 * * * * ?")
@Scheduling(cron = "0/1 * * * * ?")
private void task3() {
System.out.println(Times.nowMillis() + "每秒执行task3");
}