favo
favo
CDCloudflare Developers
Created by favo on 7/10/2024 in #workers-help
Rate Limit not limitting
I very much would love to use the new service instead of relying on my own implementation. Is there someone who can help?
6 replies
CDCloudflare Developers
Created by favo on 7/10/2024 in #workers-help
Rate Limit not limitting
if "eventually consistent" is outside of the configurable period and I can not limit someone to 1req within a 60s timeframe, whats the purpose of it at all?
6 replies
CDCloudflare Developers
Created by favo on 7/10/2024 in #workers-help
Rate Limit not limitting
reduced to the smallest testable version:
export default {
async fetch(request, env): Promise<Response> {
const { success } = await env.RPC_LIMITER.limit({ key: "test" })
if (!success) {
return new Response(`429 Failure – rate limit exceeded`, { status: 429 })
}

return new Response('success')
}
}
export default {
async fetch(request, env): Promise<Response> {
const { success } = await env.RPC_LIMITER.limit({ key: "test" })
if (!success) {
return new Response(`429 Failure – rate limit exceeded`, { status: 429 })
}

return new Response('success')
}
}
(wrangler 3.63.2) calling:
curl https://WORKER && sleep 10 && curl https://WORKER
curl https://WORKER && sleep 10 && curl https://WORKER
will always return success – even if the second call after 10 second is above the rate limit of 1 request per minute. 10 seconds to sync the storage is something I expect. Am I doing something wrong or is there an issue with the limitter?
6 replies
CDCloudflare Developers
Created by favo on 7/10/2024 in #workers-help
Rate Limit not limitting
With the above example, I set it to 1 request per minute. Running with a delay of a few seconds (5 or 30) is what I expected to be incremented at least.
6 replies
CDCloudflare Developers
Created by favo on 7/10/2024 in #workers-help
Rate Limit not limitting
When is eventually? Should it not apply after a few seconds?
6 replies