Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
59071778
Unverified
Commit
59071778
authored
Aug 26, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Aug 26, 2018
Browse files
Merge pull request #2358 from lamby/config-set-maxmemory-grammar
Tidy grammar in CONFIG SET maxmemory warning.
parents
8d519a85
f63e81c2
Changes
1
Show whitespace changes
Inline
Side-by-side
src/config.c
View file @
59071778
...
@@ -887,6 +887,17 @@ void configSetCommand(client *c) {
...
@@ -887,6 +887,17 @@ void configSetCommand(client *c) {
}
config_set_special_field
(
"masterauth"
)
{
}
config_set_special_field
(
"masterauth"
)
{
zfree
(
server
.
masterauth
);
zfree
(
server
.
masterauth
);
server
.
masterauth
=
((
char
*
)
o
->
ptr
)[
0
]
?
zstrdup
(
o
->
ptr
)
:
NULL
;
server
.
masterauth
=
((
char
*
)
o
->
ptr
)[
0
]
?
zstrdup
(
o
->
ptr
)
:
NULL
;
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"maxmemory"
))
{
if
(
getLongLongFromObject
(
o
,
&
ll
)
==
REDIS_ERR
||
ll
<
0
)
goto
badfmt
;
server
.
maxmemory
=
ll
;
if
(
server
.
maxmemory
)
{
if
(
server
.
maxmemory
<
zmalloc_used_memory
())
{
redisLog
(
REDIS_WARNING
,
"WARNING: the new maxmemory value set via CONFIG SET is smaller than the current memory usage. This will result in key eviction and/or the inability to accept new write commands depending on the maxmemory-policy."
);
}
freeMemoryIfNeeded
();
}
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"maxclients"
))
{
}
config_set_special_field
(
"cluster-announce-ip"
)
{
}
config_set_special_field
(
"cluster-announce-ip"
)
{
zfree
(
server
.
cluster_announce_ip
);
zfree
(
server
.
cluster_announce_ip
);
server
.
cluster_announce_ip
=
((
char
*
)
o
->
ptr
)[
0
]
?
zstrdup
(
o
->
ptr
)
:
NULL
;
server
.
cluster_announce_ip
=
((
char
*
)
o
->
ptr
)[
0
]
?
zstrdup
(
o
->
ptr
)
:
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment