Add admin API to list users' local media (#8647)

Add admin API `GET /_synapse/admin/v1/users/<user_id>/media` to get information of users' uploaded files.
This commit is contained in:
Dirk Klimpel 2020-10-27 15:12:31 +01:00 committed by GitHub
parent 24229fac05
commit 9b7c28283a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 494 additions and 1 deletions

View file

@ -92,6 +92,13 @@ class EventsBackgroundUpdatesStore(SQLBaseStore):
where_clause="NOT have_censored",
)
self.db_pool.updates.register_background_index_update(
"users_have_local_media",
index_name="users_have_local_media",
table="local_media_repository",
columns=["user_id", "created_ts"],
)
async def _background_reindex_fields_sender(self, progress, batch_size):
target_min_stream_id = progress["target_min_stream_id_inclusive"]
max_stream_id = progress["max_stream_id_exclusive"]