From 231619fcaa7ddd46b23df25c699c271cb92bc67e Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Fri, 5 Mar 2021 14:18:50 -0800 Subject: [PATCH] grpc-js: Timer ref and unref might not exist --- packages/grpc-js/package.json | 2 +- packages/grpc-js/src/backoff-timeout.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/grpc-js/package.json b/packages/grpc-js/package.json index 939827b28..4413d4d25 100644 --- a/packages/grpc-js/package.json +++ b/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", diff --git a/packages/grpc-js/src/backoff-timeout.ts b/packages/grpc-js/src/backoff-timeout.ts index 49a5b1e29..7f2ab5ebf 100644 --- a/packages/grpc-js/src/backoff-timeout.ts +++ b/packages/grpc-js/src/backoff-timeout.ts @@ -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, @@ -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?.(); } }