From 94da74901c854fa4135d76d5c1a070aa1f8f973c Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期日, 23 四月 2023 17:33:28 +0800 Subject: [PATCH] 优化Sip.ip的注释 --- src/main/java/com/genersoft/iot/vmp/conf/DynamicTask.java | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/DynamicTask.java b/src/main/java/com/genersoft/iot/vmp/conf/DynamicTask.java index 9ca936c..041d738 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/DynamicTask.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/DynamicTask.java @@ -127,11 +127,15 @@ public void execute(){ if (futureMap.size() > 0) { for (String key : futureMap.keySet()) { - if (futureMap.get(key).isDone()) { + if (futureMap.get(key).isDone() || futureMap.get(key).isCancelled()) { futureMap.remove(key); runnableMap.remove(key); } } } } + + public boolean isAlive(String key) { + return futureMap.get(key) != null && !futureMap.get(key).isDone() && !futureMap.get(key).isCancelled(); + } } -- Gitblit v1.8.0