mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 15:12:18 -04:00
Replace noop background updates with DELETE. (#12954)
Removes the `register_noop_background_update` and deletes the background updates directly in a delta file.
This commit is contained in:
parent
f68b5e5773
commit
53b77b203a
14 changed files with 62 additions and 146 deletions
|
@ -507,25 +507,6 @@ class BackgroundUpdater:
|
|||
update_handler
|
||||
)
|
||||
|
||||
def register_noop_background_update(self, update_name: str) -> None:
|
||||
"""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: Name of update
|
||||
"""
|
||||
|
||||
async def noop_update(progress: JsonDict, batch_size: int) -> int:
|
||||
await self._end_background_update(update_name)
|
||||
return 1
|
||||
|
||||
self.register_background_update_handler(update_name, noop_update)
|
||||
|
||||
def register_background_index_update(
|
||||
self,
|
||||
update_name: str,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue