diff options
author | Erik Johnston <erik@matrix.org> | 2016-10-24 13:35:51 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-10-24 13:35:51 +0100 |
commit | d04e2ff3a43cca3f7d393a4770f022c7bf1a372c (patch) | |
tree | 272dbeb66fc94a830c874945522cb188d42403e1 /synapse/handlers/message.py | |
parent | Merge pull request #1177 from matrix-org/paul/standard-metric-names (diff) | |
download | synapse-d04e2ff3a43cca3f7d393a4770f022c7bf1a372c.tar.xz |
Fix incredubly slow back pagination query
If a client didn't specify a from token when paginating backwards synapse would attempt to query the (global) maximum topological token. This a) doesn't make much sense since they're room specific and b) there are no indices that lets postgres do this efficiently.
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r-- | synapse/handlers/message.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 59eb26beaf..abfa8c65a4 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -82,8 +82,8 @@ class MessageHandler(BaseHandler): room_token = pagin_config.from_token.room_key else: pagin_config.from_token = ( - yield self.hs.get_event_sources().get_current_token( - direction='b' + yield self.hs.get_event_sources().get_current_token_for_room( + room_id=room_id ) ) room_token = pagin_config.from_token.room_key |