summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorNeil Johnson <neil@fragile.org.uk>2018-04-05 12:16:46 +0100
committerNeil Johnson <neil@fragile.org.uk>2018-04-05 12:16:46 +0100
commit0e5f479fc05ef9257c1bfce033c8fb91e6244ffe (patch)
tree14b9530059f7b8a06a7f4630beb4c0ec6c3a7319 /synapse/storage
parentpep8 (diff)
downloadsynapse-0e5f479fc05ef9257c1bfce033c8fb91e6244ffe.tar.xz
Review comments
Use iteritems over item to loop over dict
formatting
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/__init__.py9
1 files changed, 5 insertions, 4 deletions
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]