Browse Source

Add readOnly and routeByLatency options to Redis Cluster Store

pull/1165/head
Dakota Sullivan 5 years ago
parent
commit
301bc2f69d
No known key found for this signature in database GPG Key ID: 229C619FF594AE57
  1. 10
      weed/filer2/redis/redis_cluster_store.go

10
weed/filer2/redis/redis_cluster_store.go

@ -22,13 +22,17 @@ func (store *RedisClusterStore) Initialize(configuration util.Configuration) (er
return store.initialize( return store.initialize(
configuration.GetStringSlice("addresses"), configuration.GetStringSlice("addresses"),
configuration.GetString("password"), configuration.GetString("password"),
configuration.GetBool("connection_use_read_only"),
configuration.GetBool("connection_route_by_latency"),
) )
} }
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{ store.Client = redis.NewClusterClient(&redis.ClusterOptions{
Addrs: addresses,
Password: password,
Addrs: addresses,
Password: password,
ReadOnly: readOnly,
RouteByLatency: routeByLatency,
}) })
return return
} }
Loading…
Cancel
Save