PragmaTwice commented on code in PR #1842:
URL: https://github.com/apache/kvrocks/pull/1842#discussion_r1367146385
##########
src/config/config.cc:
##########
@@ -399,6 +412,21 @@ void Config::initFieldCallback() {
[this](Server *srv, const std::string &k, const std::string &v) ->
Status {
std::vector<std::string> args = util::Split(v, " \t");
binds = std::move(args);
+ return Status::OK();
+ }},
+ {"workers",
+ [this](Server *srv, const std::string &k, const std::string &v) ->
Status{
+ // for Config::load()
+ if (!srv) return Status::OK();
+
+ auto result_parse = ParseInt<int>(v, 10);
+ if (!result_parse) {
+ return {Status::NotOK, "Invalid arg type, need Integer"};
+ }
+ int new_workers = *result_parse;
Review Comment:
```suggestion
int new_workers = GET_OR_RET(ParseInt<int>(v, 10));
```
--
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]