Add a background update to clear tombstoned rooms from the directory (#6648)

* Add a background update to clear tombstoned rooms from the directory

* use the ABC metaclass
This commit is contained in:
Richard van der Hoff 2020-01-07 14:18:43 +00:00 committed by GitHub
parent 9824a39d80
commit 85db7f73be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 106 additions and 1 deletions

View file

@ -436,6 +436,21 @@ class BackgroundUpdater(object):
"background_updates", keyvalues={"update_name": update_name}
)
def _background_update_progress(self, update_name: str, progress: dict):
"""Update the progress of a background update
Args:
update_name: The name of the background update task
progress: The progress of the update.
"""
return self.db.runInteraction(
"background_update_progress",
self._background_update_progress_txn,
update_name,
progress,
)
def _background_update_progress_txn(self, txn, update_name, progress):
"""Update the progress of a background update