This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
synapse/storage/databases/main Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change
1
+ Fix a bug introduced in 1.54.0 that broke background updates on sqlite homeservers while search was disabled.
Original file line number Diff line number Diff line change @@ -125,9 +125,6 @@ def __init__(
125
125
):
126
126
super ().__init__ (database , db_conn , hs )
127
127
128
- if not hs .config .server .enable_search :
129
- return
130
-
131
128
self .db_pool .updates .register_background_update_handler (
132
129
self .EVENT_SEARCH_UPDATE_NAME , self ._background_reindex_search
133
130
)
@@ -243,9 +240,13 @@ def reindex_search_txn(txn):
243
240
244
241
return len (event_search_rows )
245
242
246
- result = await self .db_pool .runInteraction (
247
- self .EVENT_SEARCH_UPDATE_NAME , reindex_search_txn
248
- )
243
+ if self .hs .config .server .enable_search :
244
+ result = await self .db_pool .runInteraction (
245
+ self .EVENT_SEARCH_UPDATE_NAME , reindex_search_txn
246
+ )
247
+ else :
248
+ # Don't index anything if search is not enabled.
249
+ result = 0
249
250
250
251
if not result :
251
252
await self .db_pool .updates ._end_background_update (
You can’t perform that action at this time.
0 commit comments