infdahai commented on code in PR #1464:
URL:
https://github.com/apache/incubator-kvrocks/pull/1464#discussion_r1202519121
##########
src/commands/cmd_cluster.cc:
##########
@@ -146,7 +146,14 @@ class CommandClusterX : public Commander {
sync_migrate_ = true;
if (args.size() == 6) {
- sync_migrate_timeout_ = GET_OR_RET(ParseFloat<float>(args[5]));
+ auto parse_result = ParseInt<int>(args[5], 10);
+ if (!parse_result) {
+ return {Status::RedisParseErr, "timeout is not an integer or out
of range"};
+ }
+ if (*parse_result < 0) {
+ return {Status::RedisParseErr, "timeout should not be negative"};
Review Comment:
```suggestion
return {Status::RedisParseErr, errTimeoutIsNegative};
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]