Merge pull request #940 from matrix-org/erikj/fed_state_cache

Cache federation state responses
This commit is contained in:
Erik Johnston 2016-08-02 15:21:37 +01:00 committed by GitHub
commit 7b0f6293f2
5 changed files with 61 additions and 33 deletions

View file

@ -991,14 +991,9 @@ class FederationHandler(BaseHandler):
defer.returnValue(None)
@defer.inlineCallbacks
def get_state_for_pdu(self, origin, room_id, event_id, do_auth=True):
def get_state_for_pdu(self, room_id, event_id):
yield run_on_reactor()
if do_auth:
in_room = yield self.auth.check_host_in_room(room_id, origin)
if not in_room:
raise AuthError(403, "Host not in room.")
state_groups = yield self.store.get_state_groups(
room_id, [event_id]
)