summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorNeil Johnson <neil@fragile.org.uk>2019-10-10 21:51:27 +0100
committerNeil Johnson <neil@fragile.org.uk>2019-10-10 21:51:27 +0100
commitf9e74ebfbd2c4f6c189f0d3d49892679f673c8e2 (patch)
treecd8aabe47cd6d153c6d5f0fbef9230e297fc468f /synapse
parentrespond to review comments (diff)
downloadsynapse-github/neilj/fix_double_counting_mau_reaping.tar.xz
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/monthly_active_users.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/storage/monthly_active_users.py b/synapse/storage/monthly_active_users.py
index 584cb88789..3803604be7 100644
--- a/synapse/storage/monthly_active_users.py
+++ b/synapse/storage/monthly_active_users.py
@@ -88,7 +88,7 @@ class MonthlyActiveUsersStore(SQLBaseStore):
                 question_marks = ",".join("?" * len(reserved_users))
 
                 query_args.extend(reserved_users)
-                sql = base_sql + """ AND user_id NOT IN ({})""".format(question_marks)
+                sql = base_sql + " AND user_id NOT IN ({})".format(question_marks)
             else:
                 sql = base_sql
 
@@ -133,7 +133,8 @@ class MonthlyActiveUsersStore(SQLBaseStore):
                             ORDER BY timestamp DESC
                             LIMIT ?
                         )
-                        AND user_id NOT IN ({})""".format(
+                        AND user_id NOT IN ({})
+                    """.format(
                         question_marks, question_marks
                     )
 
@@ -182,9 +183,9 @@ class MonthlyActiveUsersStore(SQLBaseStore):
         with registered users?
 
         Returns:
-            Defered[tuple]: Real reserved users
+            Defered[list]: Real reserved users
         """
-        users = ()
+        users = []
 
         for tp in self.hs.config.mau_limits_reserved_threepids[
             : self.hs.config.max_mau_value
@@ -193,7 +194,7 @@ class MonthlyActiveUsersStore(SQLBaseStore):
                 tp["medium"], tp["address"]
             )
             if user_id:
-                users = users + (user_id,)
+                users.append(user_id)
 
         return users