summary refs log tree commit diff
path: root/synapse/storage/background_updates.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-08 16:18:01 +0100
committerErik Johnston <erik@matrix.org>2016-09-08 16:18:01 +0100
commit5beda10bbdeeed4d5535c726f32e18d5c09f2553 (patch)
tree6e657ab96f8e4bcfd7efe652aee4675b2090b6c8 /synapse/storage/background_updates.py
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-5beda10bbdeeed4d5535c726f32e18d5c09f2553.tar.xz
Reindex state_groups_state after pruning
Diffstat (limited to 'synapse/storage/background_updates.py')
-rw-r--r--synapse/storage/background_updates.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/background_updates.py b/synapse/storage/background_updates.py
index 30d0e4c5dc..003f5ba203 100644
--- a/synapse/storage/background_updates.py
+++ b/synapse/storage/background_updates.py
@@ -133,10 +133,12 @@ class BackgroundUpdateStore(SQLBaseStore):
             updates = yield self._simple_select_list(
                 "background_updates",
                 keyvalues=None,
-                retcols=("update_name",),
+                retcols=("update_name", "depends_on"),
             )
+            in_flight = set(update["update_name"] for update in updates)
             for update in updates:
-                self._background_update_queue.append(update['update_name'])
+                if update["depends_on"] not in in_flight:
+                    self._background_update_queue.append(update['update_name'])
 
         if not self._background_update_queue:
             # no work left to do