forked from mirror/redis
chore: remove old options
This commit is contained in:
parent
d001e6455b
commit
6090af686e
|
@ -1354,19 +1354,19 @@ func TestParseClusterURL(t *testing.T) {
|
||||||
o: &redis.ClusterOptions{Addrs: []string{"localhost:123", "localhost:1234"}, ReadTimeout: 2 * time.Second, PoolFIFO: true},
|
o: &redis.ClusterOptions{Addrs: []string{"localhost:123", "localhost:1234"}, ReadTimeout: 2 * time.Second, PoolFIFO: true},
|
||||||
}, {
|
}, {
|
||||||
test: "DisabledTimeout",
|
test: "DisabledTimeout",
|
||||||
url: "redis://localhost:123?idle_timeout=0",
|
url: "redis://localhost:123?conn_max_idle_time=0",
|
||||||
o: &redis.ClusterOptions{Addrs: []string{"localhost:123"}, ConnMaxIdleTime: -1},
|
o: &redis.ClusterOptions{Addrs: []string{"localhost:123"}, ConnMaxIdleTime: -1},
|
||||||
}, {
|
}, {
|
||||||
test: "DisabledTimeoutNeg",
|
test: "DisabledTimeoutNeg",
|
||||||
url: "redis://localhost:123?idle_timeout=-1",
|
url: "redis://localhost:123?conn_max_idle_time=-1",
|
||||||
o: &redis.ClusterOptions{Addrs: []string{"localhost:123"}, ConnMaxIdleTime: -1},
|
o: &redis.ClusterOptions{Addrs: []string{"localhost:123"}, ConnMaxIdleTime: -1},
|
||||||
}, {
|
}, {
|
||||||
test: "UseDefault",
|
test: "UseDefault",
|
||||||
url: "redis://localhost:123?idle_timeout=",
|
url: "redis://localhost:123?conn_max_idle_time=",
|
||||||
o: &redis.ClusterOptions{Addrs: []string{"localhost:123"}, ConnMaxIdleTime: 0},
|
o: &redis.ClusterOptions{Addrs: []string{"localhost:123"}, ConnMaxIdleTime: 0},
|
||||||
}, {
|
}, {
|
||||||
test: "UseDefaultMissing=",
|
test: "UseDefaultMissing=",
|
||||||
url: "redis://localhost:123?idle_timeout",
|
url: "redis://localhost:123?conn_max_idle_time",
|
||||||
o: &redis.ClusterOptions{Addrs: []string{"localhost:123"}, ConnMaxIdleTime: 0},
|
o: &redis.ClusterOptions{Addrs: []string{"localhost:123"}, ConnMaxIdleTime: 0},
|
||||||
}, {
|
}, {
|
||||||
test: "InvalidQueryAddr",
|
test: "InvalidQueryAddr",
|
||||||
|
|
|
@ -46,18 +46,18 @@ func TestParseURL(t *testing.T) {
|
||||||
o: &Options{Addr: "localhost:123", DB: 2, ReadTimeout: 2 * time.Second, PoolFIFO: true},
|
o: &Options{Addr: "localhost:123", DB: 2, ReadTimeout: 2 * time.Second, PoolFIFO: true},
|
||||||
}, {
|
}, {
|
||||||
// special case handling for disabled timeouts
|
// special case handling for disabled timeouts
|
||||||
url: "redis://localhost:123/?db=2&idle_timeout=0",
|
url: "redis://localhost:123/?db=2&conn_max_idle_time=0",
|
||||||
o: &Options{Addr: "localhost:123", DB: 2, ConnMaxIdleTime: -1},
|
o: &Options{Addr: "localhost:123", DB: 2, ConnMaxIdleTime: -1},
|
||||||
}, {
|
}, {
|
||||||
// negative values disable timeouts as well
|
// negative values disable timeouts as well
|
||||||
url: "redis://localhost:123/?db=2&idle_timeout=-1",
|
url: "redis://localhost:123/?db=2&conn_max_idle_time=-1",
|
||||||
o: &Options{Addr: "localhost:123", DB: 2, ConnMaxIdleTime: -1},
|
o: &Options{Addr: "localhost:123", DB: 2, ConnMaxIdleTime: -1},
|
||||||
}, {
|
}, {
|
||||||
// absent timeout values will use defaults
|
// absent timeout values will use defaults
|
||||||
url: "redis://localhost:123/?db=2&idle_timeout=",
|
url: "redis://localhost:123/?db=2&conn_max_idle_time=",
|
||||||
o: &Options{Addr: "localhost:123", DB: 2, ConnMaxIdleTime: 0},
|
o: &Options{Addr: "localhost:123", DB: 2, ConnMaxIdleTime: 0},
|
||||||
}, {
|
}, {
|
||||||
url: "redis://localhost:123/?db=2&idle_timeout", // missing "=" at the end
|
url: "redis://localhost:123/?db=2&conn_max_idle_time", // missing "=" at the end
|
||||||
o: &Options{Addr: "localhost:123", DB: 2, ConnMaxIdleTime: 0},
|
o: &Options{Addr: "localhost:123", DB: 2, ConnMaxIdleTime: 0},
|
||||||
}, {
|
}, {
|
||||||
url: "unix:///tmp/redis.sock",
|
url: "unix:///tmp/redis.sock",
|
||||||
|
|
Loading…
Reference in New Issue