summary refs log tree commit diff
path: root/synapse/util/caches/cached_call.py
diff options
context:
space:
mode:
authorJonathan de Jong <jonathan@automatia.nl>2021-07-15 18:46:54 +0200
committerGitHub <noreply@github.com>2021-07-15 12:46:54 -0400
commitbdfde6dca11a9468372b3c9b327ad3327cbdbe4a (patch)
treee3185688882f25f08cc0aefa80d8e1944c5004d9 /synapse/util/caches/cached_call.py
parentReduce likelihood of Postgres table scanning `state_groups_state`. (#10359) (diff)
downloadsynapse-bdfde6dca11a9468372b3c9b327ad3327cbdbe4a.tar.xz
Use inline type hints in `http/federation/`, `storage/` and `util/` (#10381)
Diffstat (limited to 'synapse/util/caches/cached_call.py')
-rw-r--r--synapse/util/caches/cached_call.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/util/caches/cached_call.py b/synapse/util/caches/cached_call.py

index a301c9e89b..891bee0b33 100644 --- a/synapse/util/caches/cached_call.py +++ b/synapse/util/caches/cached_call.py
@@ -63,9 +63,9 @@ class CachedCall(Generic[TV]): f: The underlying function. Only one call to this function will be alive at once (per instance of CachedCall) """ - self._callable = f # type: Optional[Callable[[], Awaitable[TV]]] - self._deferred = None # type: Optional[Deferred] - self._result = None # type: Union[None, Failure, TV] + self._callable: Optional[Callable[[], Awaitable[TV]]] = f + self._deferred: Optional[Deferred] = None + self._result: Union[None, Failure, TV] = None async def get(self) -> TV: """Kick off the call if necessary, and return the result"""