From 6dac8564112cd5bcb2f2e15413d494f43e120351 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 23 Aug 2018 01:39:01 +0200 Subject: 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. --- synapse/api/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'synapse/api') 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() -- cgit 1.5.1