This repository was archived by the owner on Jul 27, 2025. It is now read-only.
Relax API Rate Limits for Self-Hosted Deployments#2465
Merged
zachgoll merged 1 commit intomaybe-finance:mainfrom Jul 23, 2025
Merged
Conversation
zachgoll
reviewed
Jul 18, 2025
Contributor
zachgoll
left a comment
There was a problem hiding this comment.
Changes make sense to me! If you could get all tests / checks passing we can merge.
16519cc to
54c3cd2
Compare
- Introduced NoopApiRateLimiter to effectively disable API rate limiting for self-hosted mode. - Updated ApiRateLimiter to delegate to NoopApiRateLimiter when running self-hosted. - Increased Rack::Attack throttle limits significantly for self-hosted deployments. - Added tests for NoopApiRateLimiter to ensure correct behavior. - This allows self-hosted users to make more API requests without restriction, while keeping stricter limits for SaaS deployments.
54c3cd2 to
04e508c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces changes to significantly relax API rate limits for self-hosted instances of Maybe Finance, while preserving the current limits for the SaaS version.
Rationale
When importing a large number of transactions via the API in a self-hosted environment, the existing rate limits quickly become a bottleneck. This change enables power users and integrators to perform bulk imports and other high-frequency operations without being blocked by rate limiting, while ensuring that SaaS users remain protected from abuse.
Key changes
NoopApiRateLimiterto effectively disable API rate limiting for self-hosted mode.ApiRateLimiterto delegate toNoopApiRateLimiterwhen running self-hosted.NoopApiRateLimiterto ensure correct behavior.Impact
Use case:
I'm working on a project (soon open source) to import my transactions to Maybe Finance using the API. The current rate limits are blocking the import after a few imports. These changes keep the current rate limits for SaaS while relaxing them