mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-25 00:29:24 -05:00
Support for selecting the Redis logical database. (#15034)
Note that this is only used for key-value store (cached values) and not for the pub/sub replication used by Synapse.
This commit is contained in:
parent
5febf88b6c
commit
27a3a72a50
1
changelog.d/15034.feature
Normal file
1
changelog.d/15034.feature
Normal file
@ -0,0 +1 @@
|
|||||||
|
Allow Synapse to use a specific Redis [logical database](https://redis.io/commands/select/) in worker-mode deployments.
|
@ -68,6 +68,7 @@ redis:
|
|||||||
enabled: true
|
enabled: true
|
||||||
host: redis
|
host: redis
|
||||||
port: 6379
|
port: 6379
|
||||||
|
# dbid: <redis_logical_db_id>
|
||||||
# password: <secret_password>
|
# password: <secret_password>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -3927,6 +3927,9 @@ This setting has the following sub-options:
|
|||||||
* `host` and `port`: Optional host and port to use to connect to redis. Defaults to
|
* `host` and `port`: Optional host and port to use to connect to redis. Defaults to
|
||||||
localhost and 6379
|
localhost and 6379
|
||||||
* `password`: Optional password if configured on the Redis instance.
|
* `password`: Optional password if configured on the Redis instance.
|
||||||
|
* `dbid`: Optional redis dbid if needs to connect to specific redis logical db.
|
||||||
|
|
||||||
|
_Added in Synapse 1.78.0._
|
||||||
|
|
||||||
Example configuration:
|
Example configuration:
|
||||||
```yaml
|
```yaml
|
||||||
@ -3935,6 +3938,7 @@ redis:
|
|||||||
host: localhost
|
host: localhost
|
||||||
port: 6379
|
port: 6379
|
||||||
password: <secret_password>
|
password: <secret_password>
|
||||||
|
dbid: <dbid>
|
||||||
```
|
```
|
||||||
---
|
---
|
||||||
## Individual worker configuration
|
## Individual worker configuration
|
||||||
|
@ -33,4 +33,5 @@ class RedisConfig(Config):
|
|||||||
|
|
||||||
self.redis_host = redis_config.get("host", "localhost")
|
self.redis_host = redis_config.get("host", "localhost")
|
||||||
self.redis_port = redis_config.get("port", 6379)
|
self.redis_port = redis_config.get("port", 6379)
|
||||||
|
self.redis_dbid = redis_config.get("dbid", None)
|
||||||
self.redis_password = redis_config.get("password")
|
self.redis_password = redis_config.get("password")
|
||||||
|
@ -827,6 +827,7 @@ class HomeServer(metaclass=abc.ABCMeta):
|
|||||||
hs=self,
|
hs=self,
|
||||||
host=self.config.redis.redis_host,
|
host=self.config.redis.redis_host,
|
||||||
port=self.config.redis.redis_port,
|
port=self.config.redis.redis_port,
|
||||||
|
dbid=self.config.redis.redis_dbid,
|
||||||
password=self.config.redis.redis_password,
|
password=self.config.redis.redis_password,
|
||||||
reconnect=True,
|
reconnect=True,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user