mirror of https://github.com/grpc/grpc-node.git
Merge pull request #2337 from murgatroid99/grpc-js_transport_fix_active_call_tracking
grpc-js: Fix tracking of active calls in transport
This commit is contained in:
commit
cea545dd77
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@grpc/grpc-js",
|
||||
"version": "1.8.6",
|
||||
"version": "1.8.7",
|
||||
"description": "gRPC Library for Node - pure JS implementation",
|
||||
"homepage": "https://grpc.io/",
|
||||
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
||||
|
|
|
@ -354,16 +354,20 @@ class Http2Transport implements Transport {
|
|||
|
||||
private removeActiveCall(call: Http2SubchannelCall) {
|
||||
this.activeCalls.delete(call);
|
||||
if (this.activeCalls.size === 0 && !this.keepaliveWithoutCalls) {
|
||||
if (this.activeCalls.size === 0) {
|
||||
this.session.unref();
|
||||
this.stopKeepalivePings();
|
||||
if (!this.keepaliveWithoutCalls) {
|
||||
this.stopKeepalivePings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private addActiveCall(call: Http2SubchannelCall) {
|
||||
if (this.activeCalls.size === 0 && !this.keepaliveWithoutCalls) {
|
||||
if (this.activeCalls.size === 0) {
|
||||
this.session.ref();
|
||||
this.startKeepalivePings();
|
||||
if (!this.keepaliveWithoutCalls) {
|
||||
this.startKeepalivePings();
|
||||
}
|
||||
}
|
||||
this.activeCalls.add(call);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue