mirror of https://github.com/grpc/grpc-node.git
grpc-js: exitIdle asynchronously in QueuePicker, only act in exitIdle if IDLE
This commit is contained in:
parent
58345b60f1
commit
a23f739e5f
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@grpc/grpc-js",
|
||||
"version": "0.6.3",
|
||||
"version": "0.6.4",
|
||||
"description": "gRPC Library for Node - pure JS implementation",
|
||||
"homepage": "https://grpc.io/",
|
||||
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
||||
|
|
|
@ -113,7 +113,9 @@ export class QueuePicker {
|
|||
|
||||
pick(pickArgs: PickArgs): QueuePickResult {
|
||||
if (!this.calledExitIdle) {
|
||||
this.loadBalancer.exitIdle();
|
||||
process.nextTick(() => {
|
||||
this.loadBalancer.exitIdle();
|
||||
});
|
||||
this.calledExitIdle = true;
|
||||
}
|
||||
return {
|
||||
|
|
|
@ -331,14 +331,16 @@ export class ResolvingLoadBalancer implements LoadBalancer {
|
|||
}
|
||||
|
||||
exitIdle() {
|
||||
this.innerResolver.updateResolution();
|
||||
if (this.innerLoadBalancer !== null) {
|
||||
this.innerLoadBalancer.exitIdle();
|
||||
}
|
||||
this.channelControlHelper.updateState(
|
||||
ConnectivityState.CONNECTING,
|
||||
new QueuePicker(this)
|
||||
);
|
||||
if (this.currentState === ConnectivityState.IDLE) {
|
||||
this.innerResolver.updateResolution();
|
||||
this.updateState(
|
||||
ConnectivityState.CONNECTING,
|
||||
new QueuePicker(this)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
updateAddressList(
|
||||
|
|
Loading…
Reference in New Issue