diff options
author | Mark Haines <mjark@negativecurvature.net> | 2017-01-05 12:02:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-05 12:02:23 +0000 |
commit | e1c5463efc43f1bba45216cc47e88c28f09fe1be (patch) | |
tree | 24230206fed49711294cb8a190525ac4c0818003 /synapse/federation/federation_client.py | |
parent | Merge pull request #1764 from matrix-org/markjh/fix_send_pdu (diff) | |
parent | fix comment (diff) | |
download | synapse-e1c5463efc43f1bba45216cc47e88c28f09fe1be.tar.xz |
Merge pull request #1765 from matrix-org/markjh/timeout_get_missing_events
cherrypick #1744: limit total timeout for get_missing_events to 10s
Diffstat (limited to 'synapse/federation/federation_client.py')
-rw-r--r-- | synapse/federation/federation_client.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py index 6851f2376d..b4bcec77ed 100644 --- a/synapse/federation/federation_client.py +++ b/synapse/federation/federation_client.py @@ -707,7 +707,7 @@ class FederationClient(FederationBase): @defer.inlineCallbacks def get_missing_events(self, destination, room_id, earliest_events_ids, - latest_events, limit, min_depth): + latest_events, limit, min_depth, timeout): """Tries to fetch events we are missing. This is called when we receive an event without having received all of its ancestors. @@ -721,6 +721,7 @@ class FederationClient(FederationBase): have all previous events for. limit (int): Maximum number of events to return. min_depth (int): Minimum depth of events tor return. + timeout (int): Max time to wait in ms """ try: content = yield self.transport_layer.get_missing_events( @@ -730,6 +731,7 @@ class FederationClient(FederationBase): latest_events=[e.event_id for e in latest_events], limit=limit, min_depth=min_depth, + timeout=timeout, ) events = [ |