Skip to content

Commit

Permalink
same refactoring in another place
Browse files Browse the repository at this point in the history
  • Loading branch information
dougg0k committed Sep 7, 2022
1 parent c06a7c1 commit 46009fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/actions/create-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,12 @@ export const createWorker = ({
}),
client: workerClient,
});
await Promise.all([
...(killProcessingTasks && !redisClient
const clients =
killProcessingTasks && !redisClient
? [takerClient, workerClient]
: [takerClient]
).map((client) => ensureDisconnected({ client })),
: [takerClient];
await Promise.all([
...clients.map((client) => ensureDisconnected({ client })),
...[workerQueue, takerQueue].map((q) => q.onIdle()),
]);
isPaused = true;
Expand Down

0 comments on commit 46009fc

Please sign in to comment.