mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 15:05:03 -04:00
Add DeferredCache.get_immediate
method (#8568)
* Add `DeferredCache.get_immediate` method A bunch of things that are currently calling `DeferredCache.get` are only really interested in the result if it's completed. We can optimise and simplify this case. * Remove unused 'default' parameter to DeferredCache.get() * another get_immediate instance
This commit is contained in:
parent
c356b4bf42
commit
903d11c43a
7 changed files with 53 additions and 27 deletions
|
@ -531,7 +531,7 @@ class RoomMemberWorkerStore(EventsWorkerStore):
|
|||
# If we do then we can reuse that result and simply update it with
|
||||
# any membership changes in `delta_ids`
|
||||
if context.prev_group and context.delta_ids:
|
||||
prev_res = self._get_joined_users_from_context.cache.get(
|
||||
prev_res = self._get_joined_users_from_context.cache.get_immediate(
|
||||
(room_id, context.prev_group), None
|
||||
)
|
||||
if prev_res and isinstance(prev_res, dict):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue