summary refs log tree commit diff
path: root/synapse/appservice/api.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-04-20 11:31:17 +0100
committerGitHub <noreply@github.com>2018-04-20 11:31:17 +0100
commit11a67b7c9db0da43eb5d9a8df4a0410cbf031d6a (patch)
tree5c4f2338436ddfc28b4293bf658921519a6168dc /synapse/appservice/api.py
parentMerge pull request #3117 from matrix-org/rav/refactor_have_events (diff)
parentReinstate linearizer for federation_server.on_context_state_request (diff)
downloadsynapse-11a67b7c9db0da43eb5d9a8df4a0410cbf031d6a.tar.xz
Merge pull request #3093 from matrix-org/rav/response_cache_wrap
Refactor ResponseCache usage
Diffstat (limited to 'synapse/appservice/api.py')
-rw-r--r--synapse/appservice/api.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py
index 11e9c37c63..00efff1464 100644
--- a/synapse/appservice/api.py
+++ b/synapse/appservice/api.py
@@ -18,7 +18,6 @@ from synapse.api.constants import ThirdPartyEntityKind
 from synapse.api.errors import CodeMessageException
 from synapse.http.client import SimpleHttpClient
 from synapse.events.utils import serialize_event
-from synapse.util.logcontext import preserve_fn, make_deferred_yieldable
 from synapse.util.caches.response_cache import ResponseCache
 from synapse.types import ThirdPartyInstanceID
 
@@ -194,12 +193,7 @@ class ApplicationServiceApi(SimpleHttpClient):
                 defer.returnValue(None)
 
         key = (service.id, protocol)
-        result = self.protocol_meta_cache.get(key)
-        if not result:
-            result = self.protocol_meta_cache.set(
-                key, preserve_fn(_get)()
-            )
-        return make_deferred_yieldable(result)
+        return self.protocol_meta_cache.wrap(key, _get)
 
     @defer.inlineCallbacks
     def push_bulk(self, service, events, txn_id=None):