mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 14:04:55 -04:00
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
This commit is contained in:
parent
d80d505b1f
commit
03d9024cbc
3 changed files with 29 additions and 20 deletions
|
@ -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"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue