mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 21:18:58 +00:00
(minor) Add warm-up to GrpcMultiNodeChannelPool to speed up the initial messages
Without doing this, connections would be created lazily, which is probably never desirable.
This commit is contained in:
parent
904f2587cd
commit
453bd6064b
@ -40,6 +40,11 @@ public class GrpcMultiNodeChannelPool<STUB> {
|
|||||||
this.channelConstructor = channelConstructor;
|
this.channelConstructor = channelConstructor;
|
||||||
this.stubConstructor = stubConstructor;
|
this.stubConstructor = stubConstructor;
|
||||||
this.nodeConfigurationWatcher = nodeConfigurationWatcher;
|
this.nodeConfigurationWatcher = nodeConfigurationWatcher;
|
||||||
|
|
||||||
|
// Warm up the pool to reduce latency for the initial request
|
||||||
|
for (var node : nodeConfigurationWatcher.getQueryNodes()) {
|
||||||
|
apiForNode(node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user