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

Awaiting `pending` promise is required in Lambda #89

Closed unstubbable closed 6 months ago

unstubbable commented 6 months ago

I'm not sure whether this is a gap in the documentation, or actually a bug: In my single-region setup with AWS Lambda (with response streaming), I need to await pending to avoid that the lambda functions are running into task timeouts.

I tried everything else (different limiters, setting a timeout, declaring in module scope or request scope, using an ephemeralCache or not), but nothing helped, only awaiting the pending promise worked.

unstubbable commented 6 months ago

superseded by #91, and related to #90