upstash / ratelimit-js

Rate limiting library for serverless runtimes
https://ratelimit-with-vercel-kv.vercel.app
MIT License
1.65k stars 33 forks source link

fix sliding window and bucket scripts #93

Closed CahidArda closed 5 months ago

CahidArda commented 5 months ago

1 - percentageInCurrent term in the slidingWindowScript was changed as incrementBy - percentageInCurrent in #79. But it should stay as before. This is because this is used to calculate the "percentage in previous", by subtracting percentageInCurrent from 1. Not related to incrementing.

Additionally, adding a missing bracket in the tokenBucketScript which was lost when formatting scripts.

vercel[bot] commented 5 months ago

@CahidArda is attempting to deploy a commit to the Upstash Team on Vercel.

A member of the Team first needs to authorize it.