mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Don't convert to deferreds when not necessary
This commit is contained in:
parent
f9b4bb05e0
commit
86780a8bc3
5 changed files with 12 additions and 8 deletions
|
@ -341,7 +341,10 @@ class CacheDescriptor(_CacheDescriptorBase):
|
|||
cache.set(cache_key, result_d, callback=invalidate_callback)
|
||||
observer = result_d.observe()
|
||||
|
||||
return logcontext.make_deferred_yieldable(observer)
|
||||
if isinstance(observer, defer.Deferred):
|
||||
return logcontext.make_deferred_yieldable(observer)
|
||||
else:
|
||||
return observer
|
||||
|
||||
wrapped.invalidate = cache.invalidate
|
||||
wrapped.invalidate_all = cache.invalidate_all
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue