diff options
author | Erik Johnston <erik@matrix.org> | 2016-05-05 09:51:03 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-05-05 10:03:15 +0100 |
commit | 1f0f5ffa1e22dcbe2b0bb605ccaf12bf571dc624 (patch) | |
tree | 794c4083e9ffd06118123ba666b04df149ecfe9e /synapse/handlers | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/ignore_user (diff) | |
download | synapse-1f0f5ffa1e22dcbe2b0bb605ccaf12bf571dc624.tar.xz |
Add bulk fetch storage API
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/_base.py | 10 | ||||
-rw-r--r-- | synapse/handlers/sync.py | 2 |
2 files changed, 4 insertions, 8 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py index 0912274e1a..81f7929b50 100644 --- a/synapse/handlers/_base.py +++ b/synapse/handlers/_base.py @@ -95,13 +95,9 @@ class BaseHandler(object): row["event_id"] for rows in forgotten for row in rows ) - # Maps user_id -> account data content - ignore_dict_content = yield defer.gatherResults([ - preserve_fn(self.store.get_global_account_data_by_type_for_user)( - user_id, "m.ignored_user_list" - ).addCallback(lambda d, u: (u, d), user_id) - for user_id, is_peeking in user_tuples - ]).addCallback(dict) + ignore_dict_content = yield self.store.get_global_account_data_by_type_for_users( + "m.ignored_user_list", user_ids=[user_id for user_id, _ in user_tuples] + ) # FIXME: This will explode if people upload something incorrect. ignore_dict = { diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index 27c3c1b525..0bb1913285 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -522,7 +522,7 @@ class SyncHandler(BaseHandler): ) ignored_account_data = yield self.store.get_global_account_data_by_type_for_user( - user_id, "m.ignored_user_list" + "m.ignored_user_list", user_id=user_id, ) if ignored_account_data: |