Browse Source

Merge pull request #1165 from dqsully/master

Add readOnly and routeByLatency options to Redis Cluster Store
pull/1167/head
Chris Lu 5 years ago
committed by GitHub
parent
commit
cd47112c40
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      weed/command/scaffold.go
  2. 10
      weed/filer2/redis/redis_cluster_store.go

2
weed/command/scaffold.go

@ -136,6 +136,8 @@ addresses = [
"localhost:30006",
]
password = ""
readOnly = true
routeByLatency = true
[etcd]
enabled = false

10
weed/filer2/redis/redis_cluster_store.go

@ -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,
Addrs: addresses,
Password: password,
ReadOnly: readOnly,
RouteByLatency: routeByLatency,
})
return
}
Loading…
Cancel
Save