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

Commit

Permalink
Convert delete_url_cache_media to async/await. (#7241)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Apr 7, 2020
1 parent d78cb31 commit 1722b8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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
)

0 comments on commit 1722b8a

Please sign in to comment.