SGrondin / bottleneck

Job scheduler and rate limiter, supports Clustering
MIT License
1.82k stars 75 forks source link

Improve priority sanitization for floats #147

Open aletorrado opened 4 years ago

aletorrado commented 4 years ago

Hi, I've noticed that Bottleneck just uses the default priority any time a floating priority value, and it does not seem to be documented this behavior, or even that an integer is required.

Both the documentation should be improved about this matter, and Math.floor combined with Math.min and Math.max should be used to sanitize any number.