接收所有notify请求,即使没有订阅

This commit is contained in:
648540858
2022-04-15 18:04:19 +08:00
parent e6ee7fe747
commit 25102229f6
4 changed files with 92 additions and 4 deletions

View File

@@ -76,7 +76,6 @@ public class DynamicTask {
*/
public void startDelay(String key, Runnable task, int delay) {
stop(key);
System.out.println("定时任务开始了");
Date starTime = new Date(System.currentTimeMillis() + delay);
ScheduledFuture future = futureMap.get(key);
@@ -100,7 +99,6 @@ public class DynamicTask {
}
public void stop(String key) {
System.out.println("定时任务结束了");
if (futureMap.get(key) != null && !futureMap.get(key).isCancelled()) {
futureMap.get(key).cancel(true);
Runnable runnable = runnableMap.get(key);