Fix workers dealing with enterprise plans - #6595
Open
RobertJoonas wants to merge 3 commits into
Open
Conversation
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.
Changes
Two commits, two independent bug fixes:
LockSitesunlocking manually locked enterprise teamsCurrently, the
LockSitesworker automatically unlocks sites that have reduced their pageview usage and fallen back within their plan limits. But there's no exception for enterprise plans, where sites limit should matter too. Currently, if an enterprise team gets manually locked (due to not upgrading to a new enterprise plan we've created for them), the SiteLocker undoes that the next midnight, on the condition that their pageviews are OK. Fix: check the sites usage too.CheckUsage.check_site_usage_for_enterprisenot respecting grandfathered "unlimited" sitesAny accounts created before
2021-05-05have unlimited sites, butCheckUsagedoes not account for that. I don't think it has ever happened before, but currently we'd get an internal notification saying "this team has outgrown their enterprise plan... sites: 110 / 100", even though they'd see that they have unlimited sites in their team/account settings. Fix: use the globalPlausible.Teams.Billing.site_limitfunction to determine the site limit for the team.Tests
Changelog
Documentation
Dark mode