Skip to content

Attempting to use RateLimitLayer in tower::limit::rate on Axum server not working #1734

Answered by davidpdrsn
khalludi asked this question in Q&A
Discussion options

You must be logged in to vote

There is a reason tower's rate limiting middleware doesn't implement Clone. By doing what you're doing your essentially bypassing the limiting by cloning everything. The clones don't actually share the underlying service, or the bookkeeping for how many requests have been sent.

I answered a similar question previously. See #987

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by khalludi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants