Convert delete_url_cache_media to async/await. (#7241)

pull/7248/head
Patrick Cloke 2020-04-07 16:56:34 -04:00 committed by GitHub
parent d78cb31588
commit 1722b8a527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

1
changelog.d/7241.misc Normal file
View File

@ -0,0 +1 @@
Convert some of synapse.rest.media to async/await.

View File

@ -367,7 +367,7 @@ class MediaRepositoryStore(MediaRepositoryBackgroundUpdateStore):
"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
@ -380,6 +380,6 @@ class MediaRepositoryStore(MediaRepositoryBackgroundUpdateStore):
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
)