Skip to content

Commit

Permalink
Make compile with new version of NodeJS
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-andersen committed Sep 25, 2023
1 parent 2ee882e commit 7d2fa23
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions dev/src/backoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

/**
Expand Down

0 comments on commit 7d2fa23

Please sign in to comment.