diff options
Diffstat (limited to 'packages/utils/src/interval_utils.ts')
-rw-r--r-- | packages/utils/src/interval_utils.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/utils/src/interval_utils.ts b/packages/utils/src/interval_utils.ts index 6984bf42d..6784d5b35 100644 --- a/packages/utils/src/interval_utils.ts +++ b/packages/utils/src/interval_utils.ts @@ -6,18 +6,18 @@ export const intervalUtils = { intervalMs: number, onError: (err: Error) => void, ): NodeJS.Timer { - let locked = false; + let isLocked = false; const intervalId = setInterval(async () => { - if (locked) { + if (isLocked) { return; } else { - locked = true; + isLocked = true; try { await fn(); } catch (err) { onError(err); } - locked = false; + isLocked = false; } }, intervalMs); return intervalId; |