mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 08:24:55 -04:00
do mau checks based on monthly_active_users table
This commit is contained in:
parent
9180061b49
commit
74b1d46ad9
7 changed files with 97 additions and 61 deletions
|
@ -540,9 +540,7 @@ class RegistrationHandler(BaseHandler):
|
|||
Do not accept registrations if monthly active user limits exceeded
|
||||
and limiting is enabled
|
||||
"""
|
||||
if self.hs.config.limit_usage_by_mau is True:
|
||||
current_mau = yield self.store.count_monthly_users()
|
||||
if current_mau >= self.hs.config.max_mau_value:
|
||||
raise RegistrationError(
|
||||
403, "MAU Limit Exceeded", Codes.MAU_LIMIT_EXCEEDED
|
||||
)
|
||||
error = RegistrationError(
|
||||
403, "Monthly Active User limits exceeded", errcode=Codes.MAU_LIMIT_EXCEEDED
|
||||
)
|
||||
yield self.auth.check_auth_blocking(error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue