From b5bc334eb51716288186ed1c2862df6d17723345 Mon Sep 17 00:00:00 2001 From: Mathieu Velten Date: Tue, 20 Sep 2022 12:46:38 +0200 Subject: [PATCH] Update synapse/storage/_base.py Co-authored-by: reivilibre --- synapse/storage/_base.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index 946bd27f59bc..303a5d529800 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py @@ -117,10 +117,8 @@ def _attempt_to_invalidate_cache( cache = getattr(self, cache_name) except AttributeError: # Check if an externally defined module cache has been registered - external_func = self.external_cached_functions.get(cache_name) - if external_func: - cache = external_func - else: + cache = self.external_cached_functions.get(cache_name) + if not cache: # We probably haven't pulled in the cache in this worker, # which is fine. return False