Skip to content

Commit

Permalink
Merge pull request #3917 from bever1337/task/remove-all-settled
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Jan 15, 2024
2 parents b283b1c + d5f4a0b commit a397ef0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/toolkit/src/listenerMiddleware/index.ts
Expand Up @@ -46,6 +46,7 @@ import {
addAbortSignalListener,
assertFunction,
catchRejection,
noop,
} from './utils'
export { TaskAbortError } from './exceptions'
export type {
Expand Down Expand Up @@ -115,7 +116,7 @@ const createFork = (
)

if (opts?.autoJoin) {
parentBlockingPromises.push(result)
parentBlockingPromises.push(result.catch(noop))
}

return {
Expand Down Expand Up @@ -440,7 +441,7 @@ export const createListenerMiddleware = <
})
}
} finally {
await Promise.allSettled(autoJoinPromises)
await Promise.all(autoJoinPromises)

abortControllerWithReason(internalTaskController, listenerCompleted) // Notify that the task has completed
entry.pending.delete(internalTaskController)
Expand Down

0 comments on commit a397ef0

Please sign in to comment.