kopia lustrzana https://github.com/onthegomap/planetiler
undo executorservice close
rodzic
dccbf78879
commit
7487205d69
|
@ -213,7 +213,7 @@ class PrometheusStats implements Stats {
|
|||
|
||||
@Override
|
||||
public void close() {
|
||||
executor.close();
|
||||
executor.shutdown();
|
||||
push();
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class Worker {
|
|||
public Worker(String prefix, Stats stats, int threads, IntConsumerThatThrows task) {
|
||||
this.prefix = prefix;
|
||||
stats.gauge(prefix + "_threads", threads);
|
||||
try (var es = Executors.newFixedThreadPool(threads, new NamedThreadFactory(prefix))) {
|
||||
var es = Executors.newFixedThreadPool(threads, new NamedThreadFactory(prefix));
|
||||
String parentStage = LogUtil.getStage();
|
||||
List<CompletableFuture<?>> results = new ArrayList<>();
|
||||
for (int i = 0; i < threads; i++) {
|
||||
|
@ -79,9 +79,9 @@ public class Worker {
|
|||
}
|
||||
}, es));
|
||||
}
|
||||
es.shutdown();
|
||||
done = joinFutures(results);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a future that completes successfully when all {@code futures} complete, or fails immediately when the first
|
||||
|
|
Ładowanie…
Reference in New Issue