diff options
author | Erik Johnston <erik@matrix.org> | 2015-05-15 10:54:04 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-05-15 10:54:04 +0100 |
commit | a2c4f3f150f63c720370f6882da804c8ac20fd69 (patch) | |
tree | 3b1465eeecbc337c70a3313441380f4a126df7d3 /synapse/handlers/message.py | |
parent | Remove race condition (diff) | |
download | synapse-a2c4f3f150f63c720370f6882da804c8ac20fd69.tar.xz |
Fix daedlock
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r-- | synapse/handlers/message.py | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 867fdbefb0..6a1b25d112 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -303,18 +303,27 @@ class MessageHandler(BaseHandler): if event.membership != Membership.JOIN: return try: - (messages, token), current_state = yield defer.gatherResults( - [ - self.store.get_recent_events_for_room( - event.room_id, - limit=limit, - end_token=now_token.room_key, - ), - self.state_handler.get_current_state( - event.room_id - ), - ] - ).addErrback(unwrapFirstError) + # (messages, token), current_state = yield defer.gatherResults( + # [ + # self.store.get_recent_events_for_room( + # event.room_id, + # limit=limit, + # end_token=now_token.room_key, + # ), + # self.state_handler.get_current_state( + # event.room_id + # ), + # ] + # ).addErrback(unwrapFirstError) + + messages, token = yield self.store.get_recent_events_for_room( + event.room_id, + limit=limit, + end_token=now_token.room_key, + ) + current_state = yield self.state_handler.get_current_state( + event.room_id + ) start_token = now_token.copy_and_replace("room_key", token[0]) end_token = now_token.copy_and_replace("room_key", token[1]) |