Jblew / firebase-functions-rate-limiter

Js/ts library that allows you to set per-time, per-user or per-anything limits for calling Firebase cloud functions
MIT License
100 stars 15 forks source link

BUG: Multiple calls made at the same time are counting as 1 call #40

Open Jeandcc opened 1 year ago

Jeandcc commented 1 year ago

When performing some tests, calls done one after the other are "using a single token" because of them getting the exact same timestamp in seconds.

Using milliseconds for the timestamps or using a slightly different approach for registering the usage of 'tokens' should fix this issue.