summary refs log tree commit diff
path: root/synapse/util/caches
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-28 13:33:04 +0000
committerErik Johnston <erik@matrix.org>2019-10-28 13:33:04 +0000
commitd0d8a22c13427cce341dbb7ae1d92d2c0ae709c3 (patch)
tree74b184875219b30a13008d36c6dcdee427e403b1 /synapse/util/caches
parentMerge tag 'v1.5.0rc2' into develop (diff)
downloadsynapse-d0d8a22c13427cce341dbb7ae1d92d2c0ae709c3.tar.xz
Quick fix to ensure cache descriptors always return deferreds
Diffstat (limited to 'synapse/util/caches')
-rw-r--r--synapse/util/caches/descriptors.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/util/caches/descriptors.py b/synapse/util/caches/descriptors.py
index 5ac2530a6a..5a8da449b2 100644
--- a/synapse/util/caches/descriptors.py
+++ b/synapse/util/caches/descriptors.py
@@ -438,7 +438,7 @@ class CacheDescriptor(_CacheDescriptorBase):
                 if isinstance(cached_result_d, ObservableDeferred):
                     observer = cached_result_d.observe()
                 else:
-                    observer = cached_result_d
+                    observer = defer.succeed(cached_result_d)
 
             except KeyError:
                 ret = defer.maybeDeferred(
@@ -618,7 +618,7 @@ class CacheListDescriptor(_CacheDescriptorBase):
                 )
                 return make_deferred_yieldable(d)
             else:
-                return results
+                return defer.succeed(results)
 
         obj.__dict__[self.orig.__name__] = wrapped