Skip to content
Snippets Groups Projects
Unverified Commit 8e5706d1 authored by Sean Quah's avatar Sean Quah Committed by GitHub
Browse files

Fix broken background updates when using sqlite with `enable_search` off (#12215)


Signed-off-by: default avatarSean Quah <seanq@element.io>
parent 90b23270
No related branches found
No related tags found
No related merge requests found
Fix a bug introduced in 1.54.0 that broke background updates on sqlite homeservers while search was disabled.
......@@ -125,9 +125,6 @@ class SearchBackgroundUpdateStore(SearchWorkerStore):
):
super().__init__(database, db_conn, hs)
if not hs.config.server.enable_search:
return
self.db_pool.updates.register_background_update_handler(
self.EVENT_SEARCH_UPDATE_NAME, self._background_reindex_search
)
......@@ -243,9 +240,13 @@ class SearchBackgroundUpdateStore(SearchWorkerStore):
return len(event_search_rows)
result = await self.db_pool.runInteraction(
self.EVENT_SEARCH_UPDATE_NAME, reindex_search_txn
)
if self.hs.config.server.enable_search:
result = await self.db_pool.runInteraction(
self.EVENT_SEARCH_UPDATE_NAME, reindex_search_txn
)
else:
# Don't index anything if search is not enabled.
result = 0
if not result:
await self.db_pool.updates._end_background_update(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment