summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-30 15:08:26 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-30 15:08:26 +0100
commit065042c3253bc8c1176eb5dc8e7e1ed682731325 (patch)
treee79867522f4405d97ddcf236b9b8cd6f2b3d662a /synapse/storage
parentSome fixes that have become necessary due to changes in other PRs (diff)
downloadsynapse-065042c3253bc8c1176eb5dc8e7e1ed682731325.tar.xz
Code formatting and typo pointed out by Erik.
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/stats.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/synapse/storage/stats.py b/synapse/storage/stats.py
index 5f8ab9464f..4925f5b62b 100644
--- a/synapse/storage/stats.py
+++ b/synapse/storage/stats.py
@@ -232,8 +232,12 @@ class StatsStore(StateDeltasStore):
 
         yield self._unwedge_incremental_processor(old_positions)
 
-        yield self.runInteraction("populate_stats_make_skeletons", _make_skeletons, "room")
-        yield self.runInteraction("populate_stats_make_skeletons", _make_skeletons, "user")
+        yield self.runInteraction(
+            "populate_stats_make_skeletons", _make_skeletons, "room"
+        )
+        yield self.runInteraction(
+            "populate_stats_make_skeletons", _make_skeletons, "user"
+        )
         self.get_earliest_token_for_stats.invalidate_all()
 
         yield self._end_background_update("populate_stats_prepare")
@@ -264,10 +268,11 @@ class StatsStore(StateDeltasStore):
 
             # Get how many are left to process, so we can give status on how
             # far we are in processing
-            txn.execute(
-                "SELECT COUNT(*) FROM room_stats_current"
-                " WHERE completed_delta_stream_id IS NULL"
-            )
+            sql = """
+                    SELECT COUNT(*) FROM user_stats_current
+                    WHERE completed_delta_stream_id IS NULL
+                """
+            txn.execute(sql)
             progress["remaining"] = txn.fetchone()[0]
 
             return users_to_work_on
@@ -389,10 +394,10 @@ class StatsStore(StateDeltasStore):
 
             # Get how many are left to process, so we can give status on how
             # far we are in processing
-            txn.execute(
-                "SELECT COUNT(*) FROM room_stats_current"
-                " WHERE completed_delta_stream_id IS NULL"
-            )
+            sql = """
+                    SELECT COUNT(*) FROM room_stats_current
+                    WHERE completed_delta_stream_id IS NULL
+                """
             progress["remaining"] = txn.fetchone()[0]
 
             return rooms_to_work_on