-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Hi,
I have the following code:
rate = Rate(1, Duration.SECOND * 5)
bucket = InMemoryBucket([rate])
limiter = Limiter(bucket, raise_when_fail=True, max_delay=505)
limiter.try_acquire("user_1") # user_1
print("user_1")
limiter.try_acquire("user_2") # user_2
print("user_2")
I would expect, that the two try_acquire will run without problem, because is use different ids in try_acquire(). But I got the following output:
pyrate_limiter.exceptions.LimiterDelayException:
Actual delay exceeded allowance: actual=5050, allowed=505
Bucket for user_2 with Rate limit=1/5.0s is already full
It looks like user_1 and user_2 use the same bucket. I thought the should use different buckets.
pyrate-limiter==3.9.0
Python 3.12.10 on Windows 11
Thank you
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels