@grpc/grpc-js
Advanced tools
Comparing version 1.2.6 to 1.2.7
@@ -16,2 +16,3 @@ export interface BackoffOptions { | ||
private running; | ||
private hasRef; | ||
constructor(callback: () => void, options?: BackoffOptions); | ||
@@ -32,2 +33,4 @@ /** | ||
isRunning(): boolean; | ||
ref(): void; | ||
unref(): void; | ||
} |
@@ -40,2 +40,3 @@ "use strict"; | ||
this.running = false; | ||
this.hasRef = true; | ||
if (options) { | ||
@@ -68,2 +69,5 @@ if (options.initialDelay) { | ||
}, this.nextDelay); | ||
if (!this.hasRef) { | ||
this.timerId.unref(); | ||
} | ||
const nextBackoff = Math.min(this.nextDelay * this.multiplier, this.maxDelay); | ||
@@ -91,4 +95,12 @@ const jitterMagnitude = nextBackoff * this.jitter; | ||
} | ||
ref() { | ||
this.hasRef = true; | ||
this.timerId.ref(); | ||
} | ||
unref() { | ||
this.hasRef = false; | ||
this.timerId.unref(); | ||
} | ||
} | ||
exports.BackoffTimeout = BackoffTimeout; | ||
//# sourceMappingURL=backoff-timeout.js.map |
@@ -214,3 +214,3 @@ "use strict"; | ||
'. Ending call'); | ||
callStream.cancelWithStatus(constants_1.Status.INTERNAL, 'Failed to start HTTP/2 stream'); | ||
callStream.cancelWithStatus(constants_1.Status.INTERNAL, `Failed to start HTTP/2 stream with error: ${error.message}`); | ||
} | ||
@@ -217,0 +217,0 @@ } |
@@ -159,2 +159,3 @@ "use strict"; | ||
}); | ||
this.backoffTimeout.unref(); | ||
} | ||
@@ -161,0 +162,0 @@ updateResolution() { |
@@ -458,2 +458,3 @@ "use strict"; | ||
} | ||
this.backoffTimeout.ref(); | ||
if (!this.keepaliveWithoutCalls) { | ||
@@ -476,2 +477,3 @@ this.startKeepalivePings(); | ||
} | ||
this.backoffTimeout.unref(); | ||
if (!this.keepaliveWithoutCalls) { | ||
@@ -478,0 +480,0 @@ this.stopKeepalivePings(); |
{ | ||
"name": "@grpc/grpc-js", | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"description": "gRPC Library for Node - pure JS implementation", | ||
@@ -5,0 +5,0 @@ "homepage": "https://grpc.io/", |
@@ -47,2 +47,3 @@ /* | ||
private running = false; | ||
private hasRef = true; | ||
@@ -78,2 +79,5 @@ constructor(private callback: () => void, options?: BackoffOptions) { | ||
}, this.nextDelay); | ||
if (!this.hasRef) { | ||
this.timerId.unref(); | ||
} | ||
const nextBackoff = Math.min( | ||
@@ -107,2 +111,12 @@ this.nextDelay * this.multiplier, | ||
} | ||
ref() { | ||
this.hasRef = true; | ||
this.timerId.ref(); | ||
} | ||
unref() { | ||
this.hasRef = false; | ||
this.timerId.unref(); | ||
} | ||
} |
@@ -365,3 +365,3 @@ /* | ||
Status.INTERNAL, | ||
'Failed to start HTTP/2 stream' | ||
`Failed to start HTTP/2 stream with error: ${(error as Error).message}` | ||
); | ||
@@ -368,0 +368,0 @@ } |
@@ -199,2 +199,3 @@ /* | ||
}); | ||
this.backoffTimeout.unref(); | ||
} | ||
@@ -201,0 +202,0 @@ |
@@ -618,2 +618,3 @@ /* | ||
} | ||
this.backoffTimeout.ref(); | ||
if (!this.keepaliveWithoutCalls) { | ||
@@ -639,2 +640,3 @@ this.startKeepalivePings(); | ||
} | ||
this.backoffTimeout.unref(); | ||
if (!this.keepaliveWithoutCalls) { | ||
@@ -641,0 +643,0 @@ this.stopKeepalivePings(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1120971
202
22455
18
12