-
Notifications
You must be signed in to change notification settings - Fork 68
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
Go: INFO
.
#2988
base: main
Are you sure you want to change the base?
Go: INFO
.
#2988
Conversation
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
@@ -46,7 +46,7 @@ func (client *glideClient) CustomCommand(args []string) (interface{}, error) { | |||
func (client *glideClient) ConfigSet(parameters map[string]string) (string, error) { | |||
result, err := client.executeCommand(C.ConfigSet, utils.MapToString(parameters)) | |||
if err != nil { | |||
return "", err | |||
return defaultStringResponse, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job on fixing little code quality issues. We should all be looking for opportunities to do this as part of our PRs when we are already making changes to existing code.
// // `response` stores the command output from a cluster node | ||
type ClusterValue[T any] struct { | ||
valueType ValueType | ||
value Result[T] | ||
value Result[any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify why this change is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case when user runs INFO
with multi-node route, response is a map (map[string]string
), but we return ClusterValue[string]
. So we have to store that map there.
valkey-glide/go/api/glide_cluster_client.go
Line 127 in eff4257
return createClusterMultiValue[string](data), nil |
Maybe we should follow java approach and have 2 fields inside ClusterValue
:
type ClusterValue[T any] struct {
valueType ValueType
singleValue Result[T]
multiValue map[string]T
}
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
INFO
commmandClusterValue
with doc fixIssue link
This Pull Request is linked to issue (URL): #2876
Checklist
Before submitting the PR make sure the following are checked: