Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Jan 18, 2023
1 parent e6e5354 commit f649d21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion synapse/util/caches/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Awaitable,
Callable,
Collection,
Coroutine,
Dict,
Generic,
Hashable,
Expand Down Expand Up @@ -58,7 +59,7 @@


class CachedFunction(Generic[F]):
invalidate: Callable[[Tuple[Any, ...]], None]
invalidate: Callable[[Tuple[Any, ...]], Union[None, Coroutine]]
invalidate_all: Callable[[], None]
invalidate_external: Any = None
prefill: Callable[[Tuple[Any, ...], Any], None]
Expand Down
3 changes: 2 additions & 1 deletion synapse/util/caches/redis_caches.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Generic,
List,
Optional,
Tuple,
Union,
cast,
)
Expand Down Expand Up @@ -75,7 +76,7 @@ async def _wrapped(self: Any, *args: Any, **kwargs: Any) -> Any:
await redis_shard_cache.set(cache_name, cache_key, value)
return value

async def _invalidate(key: KT) -> None:
async def _invalidate(key: Tuple[Any, ...]) -> None:
return await redis_shard_cache.delete(
cache_name,
_redis_key(key),
Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class RegistrationTestCase(unittest.HomeserverTestCase):
"""Tests the RegistrationHandler."""

def make_homeserver(self, reactor: MemoryReactor, clock: Clock) -> HomeServer:
reactor.advance(1)
reactor.advance(1) # type: ignore
hs_config = self.default_config()

# some of the tests rely on us having a user consent version
Expand Down

0 comments on commit f649d21

Please sign in to comment.