Skip to content

Fix workers dealing with enterprise plans - #6595

Open
RobertJoonas wants to merge 3 commits into
masterfrom
fix-enterprise-plan-unlocking
Open

Fix workers dealing with enterprise plans#6595
RobertJoonas wants to merge 3 commits into
masterfrom
fix-enterprise-plan-unlocking

Conversation

@RobertJoonas

Copy link
Copy Markdown
Contributor

Changes

Two commits, two independent bug fixes:

  1. LockSites unlocking manually locked enterprise teams

Currently, the LockSites worker 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.

  1. CheckUsage.check_site_usage_for_enterprise not respecting grandfathered "unlimited" sites

Any accounts created before 2021-05-05 have unlimited sites, but CheckUsage does 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 global Plausible.Teams.Billing.site_limit function to determine the site limit for the team.

Tests

  • Automated tests have been added

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

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

Successfully merging this pull request may close these issues.

1 participant