mirror of https://github.com/grpc/grpc-node.git
grpc-js: Cancel and don't start idle timer on shutdown
This commit is contained in:
parent
845abcaeb2
commit
446f139b37
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@grpc/grpc-js",
|
||||
"version": "1.9.7",
|
||||
"version": "1.9.8",
|
||||
"description": "gRPC Library for Node - pure JS implementation",
|
||||
"homepage": "https://grpc.io/",
|
||||
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
||||
|
|
|
@ -554,7 +554,7 @@ export class InternalChannel {
|
|||
}
|
||||
|
||||
private maybeStartIdleTimer() {
|
||||
if (this.callCount === 0) {
|
||||
if (this.connectivityState !== ConnectivityState.SHUTDOWN && this.callCount === 0) {
|
||||
this.idleTimer = setTimeout(() => {
|
||||
this.trace(
|
||||
'Idle timer triggered after ' +
|
||||
|
@ -706,6 +706,9 @@ export class InternalChannel {
|
|||
this.resolvingLoadBalancer.destroy();
|
||||
this.updateState(ConnectivityState.SHUTDOWN);
|
||||
clearInterval(this.callRefTimer);
|
||||
if (this.idleTimer) {
|
||||
clearTimeout(this.idleTimer);
|
||||
}
|
||||
if (this.channelzEnabled) {
|
||||
unregisterChannelzRef(this.channelzRef);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue