Skip to content

Commit

Permalink
Revert "perf: avoid setImmediate if body is reading"
Browse files Browse the repository at this point in the history
This reverts commit 95f754b.
  • Loading branch information
ronag committed May 7, 2024
1 parent 95f754b commit 94c9aa9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/api/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,9 @@ class BodyReadable extends Readable {
// tick as it is created, then a user who is waiting for a
// promise (i.e micro tick) for installing a 'error' listener will
// never get a chance and will always encounter an unhandled exception.
if (!this[kReading]) {
setImmediate(() => {
callback(err)
})
} else {
setImmediate(() => {
callback(err)
}
})
}

on (ev, ...args) {
Expand Down

0 comments on commit 94c9aa9

Please sign in to comment.