summary refs log tree commit diff
path: root/synapse/storage/monthly_active_users.py
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-08-01 12:03:57 +0100
committerNeil Johnson <neil@matrix.org>2018-08-01 12:03:57 +0100
commit4e5ac901ddd15e8938605c5ac4312be804997ed5 (patch)
treee2bf22984065707e46f612ba38bea9d6d0c5ad56 /synapse/storage/monthly_active_users.py
parentfix comment (diff)
downloadsynapse-4e5ac901ddd15e8938605c5ac4312be804997ed5.tar.xz
clean up
Diffstat (limited to 'synapse/storage/monthly_active_users.py')
-rw-r--r--synapse/storage/monthly_active_users.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/synapse/storage/monthly_active_users.py b/synapse/storage/monthly_active_users.py
index 373e828c0a..03eeea792e 100644
--- a/synapse/storage/monthly_active_users.py
+++ b/synapse/storage/monthly_active_users.py
@@ -31,11 +31,8 @@ class MonthlyActiveUsersStore(SQLBaseStore):
                 defered resolves to int
         """
         def _count_users(txn):
-            sql = """
-                SELECT COALESCE(count(*), 0) FROM (
-                    SELECT user_id FROM monthly_active_users
-                ) u
-            """
+            sql = "SELECT COALESCE(count(*), 0) FROM monthly_active_users"
+
             txn.execute(sql)
             count, = txn.fetchone()
             return count
@@ -59,9 +56,6 @@ class MonthlyActiveUsersStore(SQLBaseStore):
             lock=False,
         )
 
-    def clean_out_monthly_active_users(self):
-        pass
-
     @defer.inlineCallbacks
     def is_user_monthly_active(self, user_id):
         """
@@ -79,11 +73,5 @@ class MonthlyActiveUsersStore(SQLBaseStore):
             retcol="user_id",
             desc="is_user_monthly_active",
         )
-        # jeff = self.cursor_to_dict(res)
-        result = False
-        if user_present:
-            result = True
 
-        defer.returnValue(
-            result
-        )
+        defer.returnValue(bool(user_present))