mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 21:17:54 -05:00
Remove unused ExecutorService init/termination (#419)
Signed-off-by: Horacio Mijail Anton Quiles <hmijail@gmail.com> Co-authored-by: CJ Hare <CjHare@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
3603f8d14d
commit
0a19f4750f
@@ -53,9 +53,6 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import io.vertx.core.Vertx;
|
||||
@@ -68,7 +65,6 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
|
||||
|
||||
private final Logger LOG = LogManager.getLogger();
|
||||
private final Map<String, Runner> besuRunners = new HashMap<>();
|
||||
private ExecutorService nodeExecutor = Executors.newCachedThreadPool();
|
||||
|
||||
private final Map<Node, BesuPluginContextImpl> besuPluginContextMap = new HashMap<>();
|
||||
|
||||
@@ -102,9 +98,6 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
|
||||
|
||||
@Override
|
||||
public void startNode(final BesuNode node) {
|
||||
if (nodeExecutor == null || nodeExecutor.isShutdown()) {
|
||||
nodeExecutor = Executors.newCachedThreadPool();
|
||||
}
|
||||
|
||||
final StorageServiceImpl storageService = new StorageServiceImpl();
|
||||
final Path dataDir = node.homeDirectory();
|
||||
@@ -221,14 +214,6 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
|
||||
|
||||
// iterate over a copy of the set so that besuRunner can be updated when a runner is killed
|
||||
new HashSet<>(besuRunners.keySet()).forEach(this::killRunner);
|
||||
try {
|
||||
nodeExecutor.shutdownNow();
|
||||
if (!nodeExecutor.awaitTermination(5, TimeUnit.SECONDS)) {
|
||||
throw new IllegalStateException("Failed to shut down node executor");
|
||||
}
|
||||
} catch (final InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user