5 ms·
Did you implement this in your web server or within your application? I'd love to see the code if you're willing to share
by atif089 2y ago
Did you implement this in your web server or within your application? I'd love to see the code if you're willing to share
- mmastrac 2y agoYep, it's open-source: https://github.com/progscrape/progscrape/blob/master/web/src/rate_limits.rs https://github.com/progscrape/progscrape/blob/master/web/src... Here's where we handle the rate limits: https://github.com/progscrape/progscrape/blob/master/web/src/web.rs#L229 https://github.com/progscrape/progscrape/blob/master/web/src... I actually misremembered my implementation. It's rolling counting bloom filters, not a token bucket. :)