Skip to content

fix(RequestIter): clamp waitTime sleep to prevent negative setTimeout…#826

Open
dba18714 wants to merge 1 commit intogram-js:masterfrom
dba18714:dba18714-patch-1
Open

fix(RequestIter): clamp waitTime sleep to prevent negative setTimeout…#826
dba18714 wants to merge 1 commit intogram-js:masterfrom
dba18714:dba18714-patch-1

Conversation

@dba18714
Copy link
Copy Markdown

… delay

When a chunk takes longer to load than waitTime, the expression waitTime - elapsed produces a negative value, causing Node.js to emit a TimeoutNegativeWarning. Wrap the argument with Math.max(0, ...) to ensure the delay is never negative.

… delay

When a chunk takes longer to load than `waitTime`, the expression
`waitTime - elapsed` produces a negative value, causing Node.js to emit
a `TimeoutNegativeWarning`. Wrap the argument with `Math.max(0, ...)` to
ensure the delay is never negative.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant