diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-02-02 14:32:51 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-02-02 14:32:51 +0000 |
commit | 6b02fc80d173d3d4de81623d411a136abe1637e9 (patch) | |
tree | be205b82531cde6154a4f20ee84923282f595e83 /synapse/storage/background_updates.py | |
parent | fix GIST->GIN switch (diff) | |
download | synapse-6b02fc80d173d3d4de81623d411a136abe1637e9.tar.xz |
Reinstate event_search_postgres_gist handler
People may have queued updates for this, so we can't just delete it.
Diffstat (limited to 'synapse/storage/background_updates.py')
-rw-r--r-- | synapse/storage/background_updates.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/synapse/storage/background_updates.py b/synapse/storage/background_updates.py index 11a1b942f1..c88759bf2c 100644 --- a/synapse/storage/background_updates.py +++ b/synapse/storage/background_updates.py @@ -242,6 +242,25 @@ class BackgroundUpdateStore(SQLBaseStore): """ self._background_update_handlers[update_name] = update_handler + def register_noop_background_update(self, update_name): + """Register a noop handler for a background update. + + This is useful when we previously did a background update, but no + longer wish to do the update. In this case the background update should + be removed from the schema delta files, but there may still be some + users who have the background update queued, so this method should + also be called to clear the update. + + Args: + update_name (str): Name of update + """ + @defer.inlineCallbacks + def noop_update(progress, batch_size): + yield self._end_background_update(update_name) + defer.returnValue(1) + + self.register_background_update_handler(update_name, noop_update) + def register_background_index_update(self, update_name, index_name, table, columns, where_clause=None, unique=False, |