Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Convert delete_url_cache_media to async/await. #7241

Merged
merged 1 commit into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7241.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Convert some of synapse.rest.media to async/await.
4 changes: 2 additions & 2 deletions synapse/storage/data_stores/main/media_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def _get_url_cache_media_before_txn(txn):
"get_url_cache_media_before", _get_url_cache_media_before_txn
)

def delete_url_cache_media(self, media_ids):
async def delete_url_cache_media(self, media_ids):
if len(media_ids) == 0:
return

Expand All @@ -380,6 +380,6 @@ def _delete_url_cache_media_txn(txn):

txn.executemany(sql, [(media_id,) for media_id in media_ids])

return self.db.runInteraction(
return await self.db.runInteraction(
"delete_url_cache_media", _delete_url_cache_media_txn
)