diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2020-08-05 17:04:03 -0400 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2020-08-05 17:04:03 -0400 |
commit | 460ebc558a2550a423ed859bdd0f74b22cba1859 (patch) | |
tree | 3ab978e67490cd5bc175cee767015d16d79f4aea /synapse/config/redis.py | |
parent | maybe this will make lint happy? (diff) | |
parent | Rename database classes to make some sense (#8033) (diff) | |
download | synapse-460ebc558a2550a423ed859bdd0f74b22cba1859.tar.xz |
Merge remote-tracking branch 'origin/develop' into dehydration
Diffstat (limited to 'synapse/config/redis.py')
-rw-r--r-- | synapse/config/redis.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/synapse/config/redis.py b/synapse/config/redis.py index d5d3ca1c9e..1373302335 100644 --- a/synapse/config/redis.py +++ b/synapse/config/redis.py @@ -21,7 +21,7 @@ class RedisConfig(Config): section = "redis" def read_config(self, config, **kwargs): - redis_config = config.get("redis", {}) + redis_config = config.get("redis") or {} self.redis_enabled = redis_config.get("enabled", False) if not self.redis_enabled: @@ -32,3 +32,24 @@ class RedisConfig(Config): self.redis_host = redis_config.get("host", "localhost") self.redis_port = redis_config.get("port", 6379) self.redis_password = redis_config.get("password") + + def generate_config_section(self, config_dir_path, server_name, **kwargs): + return """\ + # Configuration for Redis when using workers. This *must* be enabled when + # using workers (unless using old style direct TCP configuration). + # + redis: + # Uncomment the below to enable Redis support. + # + #enabled: true + + # Optional host and port to use to connect to redis. Defaults to + # localhost and 6379 + # + #host: localhost + #port: 6379 + + # Optional password if configured on the Redis instance + # + #password: <secret_password> + """ |