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
86e9f48a
Commit
86e9f48a
authored
Jun 22, 2017
by
xuzhou
Browse files
Optimize set command with ex/px when updating aof.
parent
530fcf86
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/aof.c
View file @
86e9f48a
...
...
@@ -536,16 +536,16 @@ void feedAppendOnlyFile(struct redisCommand *cmd, int dictid, robj **argv, int a
buf = catAppendOnlyGenericCommand(buf,3,tmpargv);
decrRefCount(tmpargv[0]);
buf = catAppendOnlyExpireAtCommand(buf,cmd,argv[1],argv[2]);
} else if (cmd->proc == setCommand) {
} else if (cmd->proc == setCommand
&& argc > 3
) {
int i;
robj *exarg = NULL, *pxarg = NULL;
/* Translate SET [EX seconds][PX milliseconds] to SET and PEXPIREAT */
buf = catAppendOnlyGenericCommand(buf,3,argv);
for (i = 3; i < argc; i ++) {
if (
sdsEncodedObject(argv[i]) &&
!strcasecmp(argv[i]->ptr, "ex"))
if (!strcasecmp(argv[i]->ptr, "ex"))
exarg = argv[i+1];
if (
sdsEncodedObject(argv[i]) &&
!strcasecmp(argv[i]->ptr, "px"))
if (!strcasecmp(argv[i]->ptr, "px"))
pxarg = argv[i+1];
}
serverAssert(!(exarg && pxarg));
...
...
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