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

Do not try to await None, which can be returned by delete_url_cache. #7184

Merged
merged 3 commits into from
Mar 31, 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/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