summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xsynapse/app/homeserver.py2
-rw-r--r--synapse/storage/__init__.py9
2 files changed, 6 insertions, 5 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 35e2b00f1b..777e9c529a 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -426,7 +426,7 @@ def run(hs):
         stats["daily_messages"] = yield hs.get_datastore().count_daily_messages()
 
         r30_results = yield hs.get_datastore().count_r30_users()
-        for name, count in r30_results.items():
+        for name, count in r30_results.iteritems():
             stats["r30_users_" + name] = count
 
         daily_sent_messages = yield hs.get_datastore().count_daily_sent_messages()
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index f68e436df0..4800584b59 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -280,8 +280,9 @@ class DataStore(RoomMemberStore, RoomStore,
 
             sql = """
                 SELECT platform, COALESCE(count(*), 0) FROM (
-                     SELECT users.name, platform, users.creation_ts * 1000,
-                                                            MAX(uip.last_seen)
+                     SELECT
+                        users.name, platform, users.creation_ts * 1000,
+                        MAX(uip.last_seen)
                      FROM users
                      INNER JOIN (
                          SELECT
@@ -310,8 +311,8 @@ class DataStore(RoomMemberStore, RoomStore,
             results = {}
             txn.execute(sql, (thirty_days_ago_in_secs,
                               thirty_days_ago_in_secs))
-            rows = txn.fetchall()
-            for row in rows:
+
+            for row in txn:
                 if row[0] is 'unknown':
                     pass
                 results[row[0]] = row[1]