mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-06 06:14:12 -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
|
@ -496,6 +496,6 @@ class _Invalidation(namedtuple("_Invalidation", ("cache", "room_id"))):
|
|||
# dedupe when we add callbacks to lru cache nodes, otherwise the number
|
||||
# of callbacks would grow.
|
||||
def __call__(self):
|
||||
rules = self.cache.get(self.room_id, None, update_metrics=False)
|
||||
rules = self.cache.get_immediate(self.room_id, None, update_metrics=False)
|
||||
if rules:
|
||||
rules.invalidate_all()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue