mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 13:18:45 -05:00
Push some deferred wrangling down into DeferredCache
This commit is contained in:
parent
7b71695388
commit
1f4269700c
5 changed files with 67 additions and 46 deletions
|
|
@ -27,7 +27,6 @@ from synapse.logging.context import (
|
|||
current_context,
|
||||
make_deferred_yieldable,
|
||||
)
|
||||
from synapse.util.async_helpers import ObservableDeferred
|
||||
from synapse.util.caches import descriptors
|
||||
from synapse.util.caches.descriptors import cached
|
||||
|
||||
|
|
@ -419,9 +418,9 @@ class CacheDecoratorTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
a = A()
|
||||
|
||||
a.func.prefill(("foo",), ObservableDeferred(d))
|
||||
a.func.prefill(("foo",), 456)
|
||||
|
||||
self.assertEquals(a.func("foo").result, d.result)
|
||||
self.assertEquals(a.func("foo").result, 456)
|
||||
self.assertEquals(callcount[0], 0)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue