Skip to content

Commit

Permalink
fix: only dequeue if status is stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Abdelwahab-Andela committed Sep 19, 2024
1 parent 63e27e7 commit 3a20ee0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/eventually/src/utils/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> => {
Expand Down

0 comments on commit 3a20ee0

Please sign in to comment.