SGrondin / bottleneck

Job scheduler and rate limiter, supports Clustering
MIT License
1.84k stars 79 forks source link

Any correct ways to do rate limit 1000 per hour? #201

Open weilinzung opened 2 years ago

weilinzung commented 2 years ago

Trying to see if a correct way to use Bottleneck to make 1000 requests to an api with one-hour rolling window.

const limiter = new Bottleneck({ reservoir: 16, reservoirRefreshAmount: 16, reservoirRefreshInterval: 60 * 1000, maxConcurrent: 1, minTime: 27 });

thanks!