Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.2.0+1 #8

Merged
merged 2 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cli/command_clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ func ClientsCommand(args CommandArgs) int {
req := &REDIS.Request{
Command: []string{"CLIENT", "LIST", "TYPE", "NORMAL"},
Port: CORE.GetInstancePort(id),
Auth: REDIS.Auth{CORE.REDIS_USER_ADMIN, meta.Preferencies.AdminPassword},
Auth: REDIS.Auth{
User: CORE.REDIS_USER_ADMIN,
Password: meta.Preferencies.AdminPassword,
},
Timeout: time.Second,
}

Expand Down
7 changes: 4 additions & 3 deletions cli/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,12 @@ func warnAboutUnsafeAction(id int, message string) bool {
case 5:
ops, err := getCurrentInstanceTraffic(id)

if ops > 10 {
switch {
case ops > 10:
terminal.Warn("There is some traffic on the instance (%d ops/s).", ops)
} else if err != nil {
case err != nil:
terminal.Warn("Can't measure the number of operations on the instance.")
} else {
default:
continue
}
}
Expand Down
18 changes: 0 additions & 18 deletions redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,24 +291,6 @@ func getClient(port int, timeout time.Duration) *redy.Client {
return client
}

// getRenamedCommand returns command with prefix
func getRenamedCommand(rc *redy.Client, rn map[string]string, command string) string {
renamedCommand, ok := rn[strings.ToUpper(command)]

if !ok {
return command
}

// Check that renamed command is supported
resp, err := rc.Cmd("COMMAND", "INFO", renamedCommand).Array()

if err != nil || len(resp) == 0 || resp[0].HasType(NIL) {
return command
}

return renamedCommand
}

// getHumanSize returns size in human readable format
func getHumanSize(size uint64) string {
f := float64(size)
Expand Down