mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #1165 from dqsully/master
Add readOnly and routeByLatency options to Redis Cluster Store
This commit is contained in:
commit
cd47112c40
|
@ -136,6 +136,8 @@ addresses = [
|
|||
"localhost:30006",
|
||||
]
|
||||
password = ""
|
||||
readOnly = true
|
||||
routeByLatency = true
|
||||
|
||||
[etcd]
|
||||
enabled = false
|
||||
|
|
|
@ -22,13 +22,17 @@ func (store *RedisClusterStore) Initialize(configuration util.Configuration) (er
|
|||
return store.initialize(
|
||||
configuration.GetStringSlice("addresses"),
|
||||
configuration.GetString("password"),
|
||||
configuration.GetBool("useReadOnly"),
|
||||
configuration.GetBool("routeByLatency"),
|
||||
)
|
||||
}
|
||||
|
||||
func (store *RedisClusterStore) initialize(addresses []string, password string) (err error) {
|
||||
func (store *RedisClusterStore) initialize(addresses []string, password string, readOnly, routeByLatency bool) (err error) {
|
||||
store.Client = redis.NewClusterClient(&redis.ClusterOptions{
|
||||
Addrs: addresses,
|
||||
Password: password,
|
||||
ReadOnly: readOnly,
|
||||
RouteByLatency: routeByLatency,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue