diff options
author | Erik Johnston <erik@matrix.org> | 2015-04-27 14:20:26 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-04-27 14:20:26 +0100 |
commit | e701aec2d1e9a565d29bc27d2bde61032cba5fd1 (patch) | |
tree | d063a41f7d68f653e38093f8f01f912bb38b0175 /synapse/rest/media/v1/base_resource.py | |
parent | Implement create_observer. (diff) | |
download | synapse-e701aec2d1e9a565d29bc27d2bde61032cba5fd1.tar.xz |
Implement locks using create_observer for fetching media and server keys
Diffstat (limited to 'synapse/rest/media/v1/base_resource.py')
-rw-r--r-- | synapse/rest/media/v1/base_resource.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/rest/media/v1/base_resource.py b/synapse/rest/media/v1/base_resource.py index edd4f78024..08c8d75af4 100644 --- a/synapse/rest/media/v1/base_resource.py +++ b/synapse/rest/media/v1/base_resource.py @@ -25,6 +25,8 @@ from twisted.internet import defer from twisted.web.resource import Resource from twisted.protocols.basic import FileSender +from synapse.util.async import create_observer + import os import logging @@ -87,7 +89,7 @@ class BaseMediaResource(Resource): def callback(media_info): del self.downloads[key] return media_info - return download + return create_observer(download) @defer.inlineCallbacks def _get_remote_media_impl(self, server_name, media_id): |