summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-04-07 16:56:34 -0400
committerGitHub <noreply@github.com>2020-04-07 21:56:34 +0100
commit1722b8a527b8caa0f76706bf4acaf240e167daf4 (patch)
tree31de34cf0519928988dfcae63fdb7c0d5574ffc1
parentAdd typing information to federation_server. (#7219) (diff)
downloadsynapse-1722b8a527b8caa0f76706bf4acaf240e167daf4.tar.xz
Convert delete_url_cache_media to async/await. (#7241)
-rw-r--r--changelog.d/7241.misc1
-rw-r--r--synapse/storage/data_stores/main/media_repository.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/7241.misc b/changelog.d/7241.misc
new file mode 100644
index 0000000000..fac5bc0403
--- /dev/null
+++ b/changelog.d/7241.misc
@@ -0,0 +1 @@
+Convert some of synapse.rest.media to async/await.
diff --git a/synapse/storage/data_stores/main/media_repository.py b/synapse/storage/data_stores/main/media_repository.py
index cf195f8aa6..8aecd414c2 100644
--- a/synapse/storage/data_stores/main/media_repository.py
+++ b/synapse/storage/data_stores/main/media_repository.py
@@ -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
         )