Skip to content

Commit

Permalink
Rename SlowLog to SlowLogGet
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Sep 9, 2020
1 parent 457cdea commit 690d9a9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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())
})
Expand Down
4 changes: 2 additions & 2 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
}
Expand Down
3 changes: 0 additions & 3 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 0 additions & 10 deletions sentinel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 690d9a9

Please sign in to comment.