mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Small optimisation to CacheListDescriptor
This commit is contained in:
parent
597013caa5
commit
e043ede4a2
3 changed files with 21 additions and 14 deletions
|
@ -311,12 +311,12 @@ class CacheListDescriptor(object):
|
|||
|
||||
try:
|
||||
res = cache.get(tuple(key))
|
||||
if not res.called:
|
||||
if not res.has_succeeded():
|
||||
res = res.observe()
|
||||
res.addCallback(lambda r, arg: (arg, r), arg)
|
||||
cached_defers[arg] = res
|
||||
else:
|
||||
results[arg] = res.result
|
||||
results[arg] = res.get_result()
|
||||
except KeyError:
|
||||
missing.append(arg)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue