Skip to content

Commit

Permalink
Merge pull request #1709 from murgatroid99/grpc-js_backoff_timeout_re…
Browse files Browse the repository at this point in the history
…f_electron

grpc-js: Timer ref and unref might not exist
  • Loading branch information
murgatroid99 committed Mar 12, 2021
2 parents f7802ae + 231619f commit 78d3605
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/grpc-js/package.json
@@ -1,6 +1,6 @@
{
"name": "@grpc/grpc-js",
"version": "1.2.10",
"version": "1.2.11",
"description": "gRPC Library for Node - pure JS implementation",
"homepage": "https://grpc.io/",
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
Expand Down
6 changes: 3 additions & 3 deletions packages/grpc-js/src/backoff-timeout.ts
Expand Up @@ -76,7 +76,7 @@ export class BackoffTimeout {
this.running = false;
}, this.nextDelay);
if (!this.hasRef) {
this.timerId.unref();
this.timerId.unref?.();
}
const nextBackoff = Math.min(
this.nextDelay * this.multiplier,
Expand Down Expand Up @@ -109,11 +109,11 @@ export class BackoffTimeout {

ref() {
this.hasRef = true;
this.timerId.ref();
this.timerId.ref?.();
}

unref() {
this.hasRef = false;
this.timerId.unref();
this.timerId.unref?.();
}
}

0 comments on commit 78d3605

Please sign in to comment.