Skip to content

Commit

Permalink
Fix use of async/await in media code (matrix-org#7184)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored and phil-flex committed Jun 16, 2020
1 parent 408ebf9 commit f8dd12f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/7184.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 @@ -340,7 +340,7 @@ def _get_expired_url_cache_txn(txn):
"get_expired_url_cache", _get_expired_url_cache_txn
)

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

Expand All @@ -349,7 +349,7 @@ def delete_url_cache(self, media_ids):
def _delete_url_cache_txn(txn):
txn.executemany(sql, [(media_id,) for media_id in media_ids])

return self.db.runInteraction("delete_url_cache", _delete_url_cache_txn)
return await self.db.runInteraction("delete_url_cache", _delete_url_cache_txn)

def get_url_cache_media_before(self, before_ts):
sql = (
Expand Down

0 comments on commit f8dd12f

Please sign in to comment.