This commit is contained in:
redkale
2023-12-11 22:18:17 +08:00
parent a2f6578503
commit f7e3f7d7ec
10 changed files with 31 additions and 24 deletions

View File

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