diff options
author | Erik Johnston <erikj@jki.re> | 2017-03-31 10:10:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-31 10:10:56 +0100 |
commit | 9cee0ce7dbbf34edc8542b4b02e36ab978da2715 (patch) | |
tree | 9832e523b67b8bb43e0bd7bbe2f3ceac233e3e1c /synapse/push | |
parent | Merge pull request #2076 from matrix-org/erikj/as_perf (diff) | |
parent | Remove unused instance variable (diff) | |
download | synapse-9cee0ce7dbbf34edc8542b4b02e36ab978da2715.tar.xz |
Merge pull request #2075 from matrix-org/erikj/cache_speed
Speed up cached function access
Diffstat (limited to 'synapse/push')
-rw-r--r-- | synapse/push/push_tools.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/synapse/push/push_tools.py b/synapse/push/push_tools.py index 287df94b4f..6835f54e97 100644 --- a/synapse/push/push_tools.py +++ b/synapse/push/push_tools.py @@ -17,15 +17,12 @@ from twisted.internet import defer from synapse.push.presentable_names import ( calculate_room_name, name_from_member_event ) -from synapse.util.logcontext import preserve_fn, preserve_context_over_deferred @defer.inlineCallbacks def get_badge_count(store, user_id): - invites, joins = yield preserve_context_over_deferred(defer.gatherResults([ - preserve_fn(store.get_invited_rooms_for_user)(user_id), - preserve_fn(store.get_rooms_for_user)(user_id), - ], consumeErrors=True)) + invites = yield store.get_invited_rooms_for_user(user_id) + joins = yield store.get_rooms_for_user(user_id) my_receipts_by_room = yield store.get_receipts_for_user( user_id, "m.read", |