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
Several days ago, I've made a typo while configuring a PromiseThrottle on the requestsPerSeconds awaited field. Consequently, the object was configured with an undefined requestsPerSeconds value and my sequence of promise was obviously not fired.
After a small deep diving a bit, I've finally understood that the undefined have been transformed into a NaN while computing the value inc = (1000 / this.requestsPerSecond) * weight. The NaN is propagated in the instruction on below and make the if (the this._execute();) unsolvable.
if(elapsed>=inc){this._execute();}else{// we have reached the limit, schedule a dequeue operationsetTimeout(function(){this.dequeue();}.bind(this),inc-elapsed);}
Is it possible to add some warning or trigger some error in case of undefined or NaN value? I would be happy to send you a PR for that if you need to!
The text was updated successfully, but these errors were encountered:
Several days ago, I've made a typo while configuring a
PromiseThrottle
on therequestsPerSeconds
awaited field. Consequently, the object was configured with anundefined
requestsPerSeconds value and my sequence of promise was obviously not fired.After a small deep diving a bit, I've finally understood that the
undefined
have been transformed into aNaN
while computing the valueinc = (1000 / this.requestsPerSecond) * weight
. TheNaN
is propagated in the instruction on below and make the if (thethis._execute();
) unsolvable.Is it possible to add some warning or trigger some error in case of
undefined
orNaN
value? I would be happy to send you a PR for that if you need to!The text was updated successfully, but these errors were encountered: