Skip to content

Commit a397ef0

Browse files
authored
Merge pull request #3917 from bever1337/task/remove-all-settled
2 parents b283b1c + d5f4a0b commit a397ef0

File tree

1 file changed

+3
-2
lines changed
  • packages/toolkit/src/listenerMiddleware

1 file changed

+3
-2
lines changed

packages/toolkit/src/listenerMiddleware/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import {
4646
addAbortSignalListener,
4747
assertFunction,
4848
catchRejection,
49+
noop,
4950
} from './utils'
5051
export { TaskAbortError } from './exceptions'
5152
export type {
@@ -115,7 +116,7 @@ const createFork = (
115116
)
116117

117118
if (opts?.autoJoin) {
118-
parentBlockingPromises.push(result)
119+
parentBlockingPromises.push(result.catch(noop))
119120
}
120121

121122
return {
@@ -440,7 +441,7 @@ export const createListenerMiddleware = <
440441
})
441442
}
442443
} finally {
443-
await Promise.allSettled(autoJoinPromises)
444+
await Promise.all(autoJoinPromises)
444445

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

0 commit comments

Comments
 (0)