fix(site): Skip rate limit on all dedicated server plans - #7266
Open
balamurali27 wants to merge 4 commits into
Open
fix(site): Skip rate limit on all dedicated server plans#7266balamurali27 wants to merge 4 commits into
balamurali27 wants to merge 4 commits into
Conversation
The exemption matched the plan name against UNLIMITED_PLANS, which held only "Unlimited" and "Unlimited - Supported". Seven of the nine plans with dedicated_server_plan set have other names (regional and Low variants), so their sites got a rate_limit in site config and were usage tracked. Check the dedicated_server_plan flag instead of the name. Site Plan is autonamed by prompt, so a new region or tier silently fell out of the list. The patch pushes an empty rate_limit to the sites that already have one, the same way plan changes clear it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (4): Last reviewed commit: "Merge branch 'develop' into dedicated-si..." | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7266 +/- ##
============================================
- Coverage 87.72% 59.88% -27.84%
============================================
Files 129 1047 +918
Lines 22974 95548 +72574
Branches 1267 1268 +1
============================================
+ Hits 20154 57221 +37067
- Misses 2792 38299 +35507
Partials 28 28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Unsuspending only pushes maintenance_mode (site.py:3067), so a site that was suspended while the patch ran would keep its rate limit for good. Only Archived sites are skipped now, since those are gone from the bench. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
balamurali27
enabled auto-merge
August 19, 2026 10:16
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Sites on a dedicated server must not be usage tracked.
Site.get_plan_config()skipped therate_limitconfig for those sites, but it decided by plan name:Nine Site Plans have
dedicated_server_planset, and all of them havecpu_time_per_day > 0. The list covers two. The other seven get a realrate_limitwritten into site config on insert and on every plan change:Unlimited - DigitalOcean,Unlimited - Hetzner,Unlimited - Supported - Hetzner,Unlimited - Low,Unlimited - Low - Hetzner,Unlimited - Low - Supported,Unlimited - Low - Supported - HetznerSite Plan is
autoname: Prompt, so the name is free text. Each new region or tier drops out of the list without a sign.plan_titleis no better — three of these plans share the titleLarge.Change
Check the
dedicated_server_planflag instead of the name, and deleteUNLIMITED_PLANS(this was its only use).Patch
New code only helps sites created or moved to a new plan after the deploy. The patch pushes
rate_limit: {}to the dedicated server sites that already have a limit in their config, which is what a plan change toUnlimitedalready does today.frappe.rate_limiter.apply()doesif rate_limit:, so an empty dict turns the limiter off. One agent job per affected site, failures are logged and skipped so an unreachable bench does not stop the migration.Tests
Two tests on
Site.get_plan_config()— a dedicated plan gets{}, a shared plan keeps the limit fromcpu_time_per_day.create_test_plangains adedicated_server_planargument.All pass.
🤖 Generated with Claude Code