diff options
Diffstat (limited to 'packages/utils/src/interval_utils.ts')
-rw-r--r-- | packages/utils/src/interval_utils.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/utils/src/interval_utils.ts b/packages/utils/src/interval_utils.ts index ebecc7015..6984bf42d 100644 --- a/packages/utils/src/interval_utils.ts +++ b/packages/utils/src/interval_utils.ts @@ -1,7 +1,11 @@ import * as _ from 'lodash'; export const intervalUtils = { - setAsyncExcludingInterval(fn: () => Promise<void>, intervalMs: number, onError: (err: Error) => void) { + setAsyncExcludingInterval( + fn: () => Promise<void>, + intervalMs: number, + onError: (err: Error) => void, + ): NodeJS.Timer { let locked = false; const intervalId = setInterval(async () => { if (locked) { @@ -21,7 +25,7 @@ export const intervalUtils = { clearAsyncExcludingInterval(intervalId: NodeJS.Timer): void { clearInterval(intervalId); }, - setInterval(fn: () => void, intervalMs: number, onError: (err: Error) => void) { + setInterval(fn: () => void, intervalMs: number, onError: (err: Error) => void): NodeJS.Timer { const intervalId = setInterval(() => { try { fn(); |