This commit is contained in:
Looly
2020-04-11 13:08:46 +08:00
parent 73fd3b849f
commit bc486cdac4
207 changed files with 1329 additions and 1355 deletions

View File

@@ -10,23 +10,12 @@ public class AddAndRemoveMainTest {
CronUtil.setMatchSecond(true);
CronUtil.start(false);
CronUtil.getScheduler().clear();
String id = CronUtil.schedule("*/2 * * * * *", new Runnable() {
@Override
public void run() {
Console.log("task running : 2s");
}
});
String id = CronUtil.schedule("*/2 * * * * *", (Runnable) () -> Console.log("task running : 2s"));
ThreadUtil.sleep(3000);
CronUtil.remove(id);
Console.log("Task Removed");
id = CronUtil.schedule("*/3 * * * * *", new Runnable() {
@Override
public void run() {
Console.log("New task add running : 3s");
}
});
CronUtil.schedule("*/3 * * * * *", (Runnable) () -> Console.log("New task add running : 3s"));
Console.log("New Task added.");
}
}

View File

@@ -13,7 +13,7 @@ import cn.hutool.core.util.IdUtil;
*/
public class TestJob {
private String jobId = IdUtil.simpleUUID();
private final String jobId = IdUtil.simpleUUID();
/**
* 执行定时任务内容