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
When using this module to throttle an often called method I noticed that after a while a TimeoutOverflowWarning would occur:
(node:25711) TimeoutOverflowWarning: 2446812003 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
It can easily be reproduced using the following script which forces the overflow to occur after about 40 seconds. The problem is that the getDelay method keeps returing a larger timeout value on every call. As it is never reset it will eventually become too large to fit in a 32-bit integer. The setTimeout will default to every 1ms which has a negative impact on performance.
When using this module to throttle an often called method I noticed that after a while a
TimeoutOverflowWarning
would occur:It can easily be reproduced using the following script which forces the overflow to occur after about 40 seconds. The problem is that the
getDelay
method keeps returing a larger timeout value on every call. As it is never reset it will eventually become too large to fit in a 32-bit integer. ThesetTimeout
will default to every 1ms which has a negative impact on performance.For now I've switched to
lodash.throttle
which does not suffer from this issue, but wanted to let you know anyway.The text was updated successfully, but these errors were encountered: