diff options
author | Neil Johnson <neil@matrix.org> | 2018-08-02 16:57:35 +0100 |
---|---|---|
committer | Neil Johnson <neil@matrix.org> | 2018-08-02 16:57:35 +0100 |
commit | 74b1d46ad9ae692774f2e9d71cbbe1cea91b4070 (patch) | |
tree | d1790607bc3a8ae00db9cfa57efd79bf3fedaac1 /synapse/storage/client_ips.py | |
parent | remove unused count_monthly_users (diff) | |
download | synapse-74b1d46ad9ae692774f2e9d71cbbe1cea91b4070.tar.xz |
do mau checks based on monthly_active_users table
Diffstat (limited to 'synapse/storage/client_ips.py')
-rw-r--r-- | synapse/storage/client_ips.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/synapse/storage/client_ips.py b/synapse/storage/client_ips.py index 506915a1ef..83d64d1563 100644 --- a/synapse/storage/client_ips.py +++ b/synapse/storage/client_ips.py @@ -97,21 +97,22 @@ class ClientIpStore(background_updates.BackgroundUpdateStore): @defer.inlineCallbacks def _populate_monthly_active_users(self, user_id): + """Checks on the state of monthly active user limits and optionally + add the user to the monthly active tables + + Args: + user_id(str): the user_id to query + """ + store = self.hs.get_datastore() - print "entering _populate_monthly_active_users" if self.hs.config.limit_usage_by_mau: - print "self.hs.config.limit_usage_by_mau is TRUE" is_user_monthly_active = yield store.is_user_monthly_active(user_id) - print "is_user_monthly_active is %r" % is_user_monthly_active if is_user_monthly_active: yield store.upsert_monthly_active_user(user_id) else: count = yield store.get_monthly_active_count() - print "count is %d" % count if count < self.hs.config.max_mau_value: - print "count is less than self.hs.config.max_mau_value " - res = yield store.upsert_monthly_active_user(user_id) - print "upsert response is %r" % res + yield store.upsert_monthly_active_user(user_id) def _update_client_ips_batch(self): def update(): |