Rename SlowLog to SlowLogGet

This commit is contained in:
Vladimir Mihailenco 2020-09-09 17:42:05 +03:00
parent 457cdea58f
commit 690d9a94f3
5 changed files with 5 additions and 18 deletions

View File

@ -2307,7 +2307,7 @@ func (c cmdable) SlaveOf(ctx context.Context, host, port string) *StatusCmd {
return cmd
}
func (c cmdable) SlowLog(ctx context.Context, num int64) *SlowLogCmd {
func (c cmdable) SlowLogGet(ctx context.Context, num int64) *SlowLogCmd {
n := strconv.FormatInt(num, 10)
cmd := NewSlowLogCmd(context.Background(), "slowlog", "get", n)
_ = c(ctx, cmd)

View File

@ -4014,7 +4014,7 @@ var _ = Describe("Commands", func() {
})
})
Describe("SlowLog", func() {
Describe("SlowLogGet", func() {
It("returns slow query result", func() {
const key = "slowlog-log-slower-than"
@ -4027,7 +4027,7 @@ var _ = Describe("Commands", func() {
client.Set(ctx, "test", "true", 0)
result, err := client.SlowLog(ctx, -1).Result()
result, err := client.SlowLogGet(ctx, -1).Result()
Expect(err).NotTo(HaveOccurred())
Expect(len(result)).NotTo(BeZero())
})

View File

@ -511,7 +511,7 @@ func ExampleNewUniversalClient_cluster() {
rdb.Ping(ctx)
}
func ExampleClient_SlowLog() {
func ExampleClient_SlowLogGet() {
const key = "slowlog-log-slower-than"
old := rdb.ConfigGet(ctx, key).Val()
@ -524,7 +524,7 @@ func ExampleClient_SlowLog() {
rdb.Set(ctx, "test", "true", 0)
result, err := rdb.SlowLog(ctx, -1).Result()
result, err := rdb.SlowLogGet(ctx, -1).Result()
if err != nil {
panic(err)
}

View File

@ -104,9 +104,6 @@ type Options struct {
// Enables read only queries on slave nodes.
readOnly bool
// Enables read only queries on redis replicas in sentinel mode
sentinelReadOnly bool
// TLS Config to use. When set TLS will be negotiated.
TLSConfig *tls.Config

View File

@ -78,11 +78,6 @@ var _ = Describe("Sentinel", func() {
return master.Ping(ctx).Err()
}, "15s", "100ms").Should(HaveOccurred())
// Wait for Redis sentinel to elect new master.
Eventually(func() string {
return sentinelSlave1.Info(ctx).Val() + sentinelSlave2.Info(ctx).Val()
}, "15s", "100ms").Should(ContainSubstring("role:master"))
// Check that client picked up new master.
Eventually(func() error {
return client.Get(ctx, "foo").Err()
@ -183,11 +178,6 @@ var _ = Describe("NewFailoverClusterClient", func() {
return sentinelMaster.Ping(ctx).Err()
}, "15s", "100ms").Should(HaveOccurred())
// Wait for Redis sentinel to elect new master.
Eventually(func() string {
return sentinelSlave1.Info(ctx).Val() + sentinelSlave2.Info(ctx).Val()
}, "15s", "100ms").Should(ContainSubstring("role:master"))
// Check that client picked up new master.
Eventually(func() error {
return client.Get(ctx, "foo").Err()