You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
It seems that setTimeout internally uses a signed 32 bit integer to represent the number of milliseconds to "sleep", giving a maximum delay of 2147483647 ms, about 24.9 days. This might seem like a lot, and I'm sure it doesn't pop up as an issue in in-browser Javascript implementations. However, there are a few cron modules in npm that naively use setTimeout and thus break on once-a-month and similar schedules.
As far as I can see, the setTimeout method is only specified in some HTML5 draft (?) and it says nothing there about a maximum delay value or what should be done if it's exceeded. I'd consider it less surprising and more robust to have setTimeout throw an exception than call the callback immediately when the requested delay is impossible...