mirror of
https://github.com/fluencelabs/redis
synced 2025-05-29 02:01:19 +00:00
Support "1G" etc. units in CONFIG SET maxmemory
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
This commit is contained in:
parent
967590de6e
commit
260cfcf7bd
@ -628,8 +628,9 @@ void configSetCommand(redisClient *c) {
|
|||||||
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")) {
|
} else if (!strcasecmp(c->argv[2]->ptr,"maxmemory")) {
|
||||||
if (getLongLongFromObject(o,&ll) == REDIS_ERR ||
|
int err;
|
||||||
ll < 0) goto badfmt;
|
ll = memtoll(o->ptr,&err);
|
||||||
|
if (err || ll < 0) goto badfmt;
|
||||||
server.maxmemory = ll;
|
server.maxmemory = ll;
|
||||||
if (server.maxmemory) {
|
if (server.maxmemory) {
|
||||||
if (server.maxmemory < zmalloc_used_memory()) {
|
if (server.maxmemory < zmalloc_used_memory()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user