diff options
author | Erik Johnston <erik@matrix.org> | 2017-05-02 10:46:01 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-05-17 16:55:40 +0100 |
commit | 66d8ffabbdfa1fadd107851c8a0362a74149b37b (patch) | |
tree | f343c2eebce037e480dddc8f02f86b0a64f6fd24 /synapse/handlers | |
parent | Merge pull request #2216 from slipeer/app_services_interested_in_user (diff) | |
download | synapse-66d8ffabbdfa1fadd107851c8a0362a74149b37b.tar.xz |
Faster push rule calculation via push specific cache
We add a push rule specific cache that ensures that we can reuse calculated push rules appropriately when a user join/leaves.
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/message.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 196925edad..ba8776f288 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -54,6 +54,8 @@ class MessageHandler(BaseHandler): # This is to stop us from diverging history *too* much. self.limiter = Limiter(max_count=5) + self.action_generator = ActionGenerator(self.hs) + @defer.inlineCallbacks def purge_history(self, room_id, event_id): event = yield self.store.get_event(event_id) @@ -590,8 +592,7 @@ class MessageHandler(BaseHandler): "Changing the room create event is forbidden", ) - action_generator = ActionGenerator(self.hs) - yield action_generator.handle_push_actions_for_event( + yield self.action_generator.handle_push_actions_for_event( event, context ) |