mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-06 09:15:01 -04:00
Add type hints for most HomeServer
parameters (#11095)
This commit is contained in:
parent
b9ce53e878
commit
2b82ec425f
58 changed files with 342 additions and 143 deletions
|
@ -800,9 +800,14 @@ class HomeServer(metaclass=abc.ABCMeta):
|
|||
return ExternalCache(self)
|
||||
|
||||
@cache_in_self
|
||||
def get_outbound_redis_connection(self) -> Optional["RedisProtocol"]:
|
||||
if not self.config.redis.redis_enabled:
|
||||
return None
|
||||
def get_outbound_redis_connection(self) -> "RedisProtocol":
|
||||
"""
|
||||
The Redis connection used for replication.
|
||||
|
||||
Raises:
|
||||
AssertionError: if Redis is not enabled in the homeserver config.
|
||||
"""
|
||||
assert self.config.redis.redis_enabled
|
||||
|
||||
# We only want to import redis module if we're using it, as we have
|
||||
# `txredisapi` as an optional dependency.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue