Dynamic token cost on Ratelimit.tokenBucket algorithm
norberto-e-888 opened this issue · 3 comments
norberto-e-888 commented
Is there a way to dynamically calculate how many tokens a request should cost?
chronark commented
Check this script: https://github.com/upstash/ratelimit/blob/c509628a6c1490121d810822ce7c880ddb02c44c/packages/sdk/src/single.ts#L284
It's either 3 or 4, depending on whether the bucket exists and its state
github-actions commented
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
github-actions commented
This issue was closed because it has been stalled for 30 days with no activity.