Skip to content

Commit

Permalink
Add timeout delay
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis committed Dec 15, 2024
1 parent 456df5a commit eff81eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ function timeoutPromise (timeout) {
// if no timeout is specified, never settle
if (!timeout) return

setTimeout(() => reject(new TimeoutError(timeout)), timeout)
// delay timeout by 100ms so any parallel promise with same timeout will throw first
const delay = 100
setTimeout(() => reject(new TimeoutError(timeout)), timeout + delay)
})
}

Expand Down

0 comments on commit eff81eb

Please sign in to comment.