diff options
author | David Baker <dave@matrix.org> | 2015-12-22 17:04:31 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2015-12-22 17:04:31 +0000 |
commit | 4c8f6a7e427cc0e22ff1a19c3f1d9da0f9438f18 (patch) | |
tree | 9033a7a82ff6f7339f654af6d7589b3a29bc1658 /synapse/push/action_generator.py | |
parent | clarify problems (diff) | |
download | synapse-4c8f6a7e427cc0e22ff1a19c3f1d9da0f9438f18.tar.xz |
Insert push actions in a single db query rather than one per user/profile_tag
Diffstat (limited to 'synapse/push/action_generator.py')
-rw-r--r-- | synapse/push/action_generator.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/push/action_generator.py b/synapse/push/action_generator.py index 2ad5f82da2..148b1bda8e 100644 --- a/synapse/push/action_generator.py +++ b/synapse/push/action_generator.py @@ -43,7 +43,9 @@ class ActionGenerator: actions_by_user = bulk_evaluator.action_for_event_by_user(event) - for uid,actions in actions_by_user.items(): - self.store.set_actions_for_event( - event, uid, None, actions - ) + yield self.store.set_actions_for_event_and_users( + event, + [ + (uid, None, actions) for uid, actions in actions_by_user.items() + ] + ) |