-
Notifications
You must be signed in to change notification settings - Fork 143
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
Add config rewrite
#104
Add config rewrite
#104
Conversation
5a5ab99
to
9a85d4a
Compare
9a85d4a
to
f00791e
Compare
f00791e
to
5d9e2df
Compare
9559b5a
to
6d12f07
Compare
|
||
bool config_option_changable(const char *option) | ||
{ | ||
const char *CHANGABLE_OPTIONS[] = {"node", "loglevel", "slowlog-log-slower-than"}; |
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.
We should put it in the doc.
} | ||
|
||
// Caller should free the returned vector. | ||
// Return an empty line array if fail to open or read old config file. |
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.
Typo here: read old config file
=> read empty config file
if (EOF == fputs(buf.data, fp)) { | ||
goto end; | ||
} | ||
// Note that dict_set will save the key in its inner space |
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.
save the key pointer in its inner space
void *WRITTEN_TAG = (void*)1; | ||
struct dict written_tags, options_map; | ||
dict_init(&written_tags); | ||
dict_init(&options_map); |
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.
dict_set
will not overwrite the same key. It just add the key again with another value.
In the PR #95 I explained why we need
config set node
:The first problem has been solved by #95, so we continue to address the second one by adding a new command
config rewrite
.