[ISSUE #485] Fix the bug where the scheduled task only runs corePoolSize times

This commit is contained in:
kamtohung 2024-10-13 12:48:17 +08:00
parent 305b62c5dc
commit 0fbb11d888

View File

@ -21,7 +21,6 @@ import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import java.util.Objects;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import static org.dromara.dynamictp.common.constant.DynamicTpConst.TRACE_ID;
@ -51,8 +50,10 @@ public final class ExecutorUtil {
}
if (r instanceof FutureTask) {
try {
Future<?> future = (Future<?>) r;
future.get();
FutureTask<?> future = (FutureTask<?>) r;
if (future.isDone()) {
future.get();
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (Exception e) {