Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RateLimiter stored globally in Redis #1243

Open
Lucisu opened this issue Aug 8, 2024 · 3 comments
Open

RateLimiter stored globally in Redis #1243

Lucisu opened this issue Aug 8, 2024 · 3 comments
Assignees

Comments

@Lucisu
Copy link

Lucisu commented Aug 8, 2024

Bug description

When using Laravel's RateLimiter, the attempts are stored globally instead of separately per tenant.

Steps to reproduce

Execute in the first tenant:

RateLimiter::attempt( 'key', 100, function () { return true; }, 60*60 );

In the second tenant, you can see that the remaining attempts is 99 instead of 100:

RateLimiter::remaining( 'key', 100 );

Expected behavior

Like the Cache calls, I think that RateLimiter calls should be separated by the tenant.

Laravel version

11.9

stancl/tenancy version

3.8

@Lucisu Lucisu added the bug Something isn't working label Aug 8, 2024
@stancl
Copy link
Member

stancl commented Aug 8, 2024

What bootstrappers do you have enabled?

@Lucisu
Copy link
Author

Lucisu commented Aug 8, 2024

The default ones from 3.8, nothing changed

@stancl
Copy link
Member

stancl commented Aug 9, 2024

Does enabling the RedisTenancyBootstrapper fix this?

@stancl stancl removed the bug Something isn't working label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants