Hi, I have read the source code and found out that it deletes the field in bucket + 1, and bucket + 2. Would this cause any issue when we set the interval to the bucket_span?
ratelimit = Ratelimit.new("messages", bucket_span : 60, bucket_interval : 20 )
5.times do
ratelimit.add(phone_number)
end
ratelimit.count(phone_number, 60)
Using the example in the document for example and set the span to 60 interval to 20, if we set add the phone number in the first 20 second and add the phone number in the next 20 sec and so on, the count will always be 5.
Thanks!
Hi, I have read the source code and found out that it deletes the field in bucket + 1, and bucket + 2. Would this cause any issue when we set the interval to the bucket_span?
ratelimit = Ratelimit.new("messages", bucket_span : 60, bucket_interval : 20 )
5.times do
ratelimit.add(phone_number)
end
ratelimit.count(phone_number, 60)
Using the example in the document for example and set the span to 60 interval to 20, if we set add the phone number in the first 20 second and add the phone number in the next 20 sec and so on, the count will always be 5.
Thanks!