diff --git a/libs/eventually/src/utils/scheduler.ts b/libs/eventually/src/utils/scheduler.ts index 67d6e54a..2478a1a3 100644 --- a/libs/eventually/src/utils/scheduler.ts +++ b/libs/eventually/src/utils/scheduler.ts @@ -63,7 +63,7 @@ export const scheduler = (name: string): Schedule => { const enqueue = (action: Action): void => { if (_status === "stopping" || _status === "paused") return; queue.push(action); - setImmediate(dequeue); + _status === "stopped" && setImmediate(dequeue); }; const dequeue = async (): Promise => {