summary refs log tree commit diff
path: root/synapse/media/v1/download_resource.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-12-11 16:48:11 +0000
committerMark Haines <mark.haines@matrix.org>2014-12-11 16:48:11 +0000
commit03d9024cbcb4957b223d1a36e7ae2ad668b1859d (patch)
treed20e42445d3a9bbef5bdf2bb57daaff05bdb054b /synapse/media/v1/download_resource.py
parentLimit the size of images that are thumbnailed serverside. Limit the size of f... (diff)
downloadsynapse-03d9024cbcb4957b223d1a36e7ae2ad668b1859d.tar.xz
Allow only one download for a given image at a time, so that we don't end up downloading the same image twice if two clients request a remote image at the same time
Diffstat (limited to 'synapse/media/v1/download_resource.py')
-rw-r--r--synapse/media/v1/download_resource.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/synapse/media/v1/download_resource.py b/synapse/media/v1/download_resource.py
index 6de0932ba3..f3a6804e05 100644
--- a/synapse/media/v1/download_resource.py
+++ b/synapse/media/v1/download_resource.py
@@ -56,14 +56,7 @@ class DownloadResource(BaseMediaResource):
 
     @defer.inlineCallbacks
     def _respond_remote_file(self, request, server_name, media_id):
-        media_info = yield self.store.get_cached_remote_media(
-            server_name, media_id
-        )
-
-        if not media_info:
-            media_info = yield self._download_remote_file(
-                server_name, media_id
-            )
+        media_info = yield self._get_remote_media(server_name, media_id)
 
         media_type = media_info["media_type"]
         filesystem_id = media_info["filesystem_id"]