PragmaTwice commented on code in PR #1842:
URL: https://github.com/apache/kvrocks/pull/1842#discussion_r1367141241


##########
src/config/config.cc:
##########
@@ -301,6 +301,19 @@ void Config::initFieldValidator() {
          }
          return Status::OK();
        }},
+      {"workers",
+       [](const std::string &k, const std::string &v) -> Status{
+         auto result_parse = ParseInt<int>(v, 10);
+         if (!result_parse) {
+           return {Status::NotOK, "Invalid arg type, need Integer"};
+         }
+         int new_workers = *result_parse;
+
+         if (new_workers < 1) {
+           return {Status::NotOK, "workers number must more than 1"};
+         }

Review Comment:
   if you mean **more than 1** here, the condition should be `new_workers <= 1`



##########
src/config/config.cc:
##########
@@ -301,6 +301,19 @@ void Config::initFieldValidator() {
          }
          return Status::OK();
        }},
+      {"workers",
+       [](const std::string &k, const std::string &v) -> Status{
+         auto result_parse = ParseInt<int>(v, 10);
+         if (!result_parse) {
+           return {Status::NotOK, "Invalid arg type, need Integer"};
+         }
+         int new_workers = *result_parse;
+
+         if (new_workers < 1) {
+           return {Status::NotOK, "workers number must more than 1"};
+         }

Review Comment:
   if you mean ***more than 1*** here, the condition should be `new_workers <= 
1`



-- 
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]

Reply via email to