summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-04-21 17:45:56 +0100
committerErik Johnston <erik@matrix.org>2016-04-21 17:45:56 +0100
commit26db18bc90e745e1eb054e2ffd6969918a6253c4 (patch)
treeffe8a9034462eb8f06a041f4ad4b928cd10ac796 /synapse/storage
parentUpdate progress when creating index (diff)
downloadsynapse-26db18bc90e745e1eb054e2ffd6969918a6253c4.tar.xz
Need to do _background_update_progress_txn in actual transaction
Diffstat (limited to '')
-rw-r--r--synapse/storage/search.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/synapse/storage/search.py b/synapse/storage/search.py
index 1baed674a8..fd40b44a9a 100644
--- a/synapse/storage/search.py
+++ b/synapse/storage/search.py
@@ -158,14 +158,16 @@ class SearchStore(BackgroundUpdateStore):
                 )
                 conn.set_session(autocommit=False)
 
-                pg = dict(progress)
-                pg["have_added_indexes"] = True
+            yield self.runWithConnection(create_index)
 
-                self._background_update_progress_txn(
-                    conn.cursor(), self.EVENT_SEARCH_ORDER_UPDATE_NAME, progress
-                )
+            pg = dict(progress)
+            pg["have_added_indexes"] = True
 
-            yield self.runWithConnection(create_index)
+            yield self.runInteraction(
+                self.EVENT_SEARCH_ORDER_UPDATE_NAME,
+                self._background_update_progress_txn,
+                self.EVENT_SEARCH_ORDER_UPDATE_NAME, progress,
+            )
 
         INSERT_CLUMP_SIZE = 1000