summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2018-08-23 01:39:01 +0200
committerMatthew Hodgson <matthew@matrix.org>2018-08-23 01:39:01 +0200
commit6dac8564112cd5bcb2f2e15413d494f43e120351 (patch)
treec53f9f06bad75ffd11f94b643614db5e1f3fd081 /synapse/api
parentMerge branch 'master' into develop (diff)
downloadsynapse-6dac8564112cd5bcb2f2e15413d494f43e120351.tar.xz
add mau_trial_days config param.
only consider users MAU after they've been around N days.
This is an alternative implementation to https://github.com/matrix-org/synapse/pull/3739
as suggested by @neilisfragile, which is much simpler as you just hold off adding
users to the MAU table until they've been active for more than N days.
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 6502a6be7b..3d8e7ae5de 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -793,8 +793,8 @@ class Auth(object):
         if self.hs.config.limit_usage_by_mau is True:
             # If the user is already part of the MAU cohort
             if user_id:
-                timestamp = yield self.store.user_last_seen_monthly_active(user_id)
-                if timestamp:
+                activity = yield self.store.user_last_seen_monthly_active(user_id)
+                if activity:
                     return
             # Else if there is no room in the MAU bucket, bail
             current_mau = yield self.store.get_monthly_active_count()