diff options
author | Neil Johnson <neil@matrix.org> | 2018-08-07 17:59:27 +0100 |
---|---|---|
committer | Neil Johnson <neil@matrix.org> | 2018-08-07 17:59:27 +0100 |
commit | ef3589063adddd1eee89f136e6a54250cce414a1 (patch) | |
tree | ff18f596b9bdbebbbf12612f59f93b7a13aa2e67 /synapse/storage/monthly_active_users.py | |
parent | implement reserved users for mau limits (diff) | |
download | synapse-ef3589063adddd1eee89f136e6a54250cce414a1.tar.xz |
prevent total number of reserved users being too large
Diffstat (limited to 'synapse/storage/monthly_active_users.py')
-rw-r--r-- | synapse/storage/monthly_active_users.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/storage/monthly_active_users.py b/synapse/storage/monthly_active_users.py index 168f564ed5..54de5a8686 100644 --- a/synapse/storage/monthly_active_users.py +++ b/synapse/storage/monthly_active_users.py @@ -39,7 +39,9 @@ class MonthlyActiveUsersStore(SQLBaseStore): # TODO Why can't I do this in init? store = self.hs.get_datastore() reserved_user_list = [] - for tp in threepids: + + # Do not add more reserved users than the total allowable number + for tp in threepids[:self.hs.config.max_mau_value]: user_id = yield store.get_user_id_by_threepid( tp["medium"], tp["address"] ) |