From 7d2fa232bee38e04c82f1e8cec97c0be213031da Mon Sep 17 00:00:00 2001 From: Tom Andersen Date: Mon, 25 Sep 2023 19:22:57 -0400 Subject: [PATCH] Make compile with new version of NodeJS --- dev/src/backoff.ts | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/dev/src/backoff.ts b/dev/src/backoff.ts index 4ec81c91b..9b395acc4 100644 --- a/dev/src/backoff.ts +++ b/dev/src/backoff.ts @@ -58,8 +58,7 @@ export const MAX_RETRY_ATTEMPTS = 10; /*! * The timeout handler used by `ExponentialBackoff` and `BulkWriter`. */ -export let delayExecution: (f: () => void, ms: number) => NodeJS.Timeout = - setTimeout; +export let delayExecution: (f: () => void, ms: number) => void = setTimeout; /** * Allows overriding of the timeout handler used by the exponential backoff @@ -74,27 +73,7 @@ export let delayExecution: (f: () => void, ms: number) => NodeJS.Timeout = export function setTimeoutHandler( handler: (f: () => void, ms: number) => void ): void { - delayExecution = (f: () => void, ms: number) => { - handler(f, ms); - const timeout: NodeJS.Timeout = { - hasRef: () => { - throw new Error('For tests only. Not Implemented'); - }, - ref: () => { - throw new Error('For tests only. Not Implemented'); - }, - refresh: () => { - throw new Error('For tests only. Not Implemented'); - }, - unref: () => { - throw new Error('For tests only. Not Implemented'); - }, - [Symbol.toPrimitive]: () => { - throw new Error('For tests only. Not Implemented'); - }, - }; - return timeout; - }; + delayExecution = handler; } /**