From 690d9a94f359f2251d7ee94d865619134daec426 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Wed, 9 Sep 2020 17:42:05 +0300 Subject: [PATCH] Rename SlowLog to SlowLogGet --- commands.go | 2 +- commands_test.go | 4 ++-- example_test.go | 4 ++-- options.go | 3 --- sentinel_test.go | 10 ---------- 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/commands.go b/commands.go index f7946c59..b29e4f38 100644 --- a/commands.go +++ b/commands.go @@ -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) diff --git a/commands_test.go b/commands_test.go index 2040decc..ce26cfa8 100644 --- a/commands_test.go +++ b/commands_test.go @@ -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()) }) diff --git a/example_test.go b/example_test.go index 63d9f8cf..e24698ea 100644 --- a/example_test.go +++ b/example_test.go @@ -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) } diff --git a/options.go b/options.go index b44e44cb..1be7c8b5 100644 --- a/options.go +++ b/options.go @@ -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 diff --git a/sentinel_test.go b/sentinel_test.go index 485436c8..c45be73b 100644 --- a/sentinel_test.go +++ b/sentinel_test.go @@ -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()