diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt index 092140cc..8936c52b 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt @@ -74,7 +74,7 @@ class GrpcUpstreams( val client = ReactorBlockchainGrpc.newReactorStub(channel.build()) this.client = client var i = 0 - val grpcExecutor = Executors.newFixedThreadPool(64) { r -> Thread(r, "grpc-up-$id-${i++}") }; + val grpcExecutor = Executors.newCachedThreadPool { r -> Thread(r, "grpc-up-$id-${i++}") }; this.grpcTransport = EmeraldGrpcTransport.newBuilder() .forChannel(client.channel) .setObjectMapper(objectMapper)