-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setInterval and setTimeout are limited to 24 days delay #34
Comments
@mau31415 can you please submit a PR? Thank you for this finding. 🙏 |
This limit is not resolved as far as I can tell. If you look at the docs at https://nodejs.org/api/timers.html#settimeoutcallback-delay-args it states:
|
I am reverting that PR in the interim until further comments show that this is not the case. Also, a working test case would be great. |
you are right, it is still the case... |
Okay! No worries, going to close this issue for now. If you have a workaround you want to implement please do. Note that I'm pushing a bunch of updates in the next few minutes to master branch, so you may want to update your fork (or delete it and re-fork it). |
In old node version setTimeout was limited to 32bit timeout which translate to 24 days. On a larger numbers it would overflow. To avoid this issue, "Later" had capped the maximum delay to 32bit delay. However, this limit in node was resolved many years ago.
This adjustment in "later" should be removed also.
t = diff < 2147483647 ? setTimeout(fn, diff) : setTimeout(scheduleTimeout, 2147483647);
this if needs to be removed.
The text was updated successfully, but these errors were encountered: