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
b0b74486
Commit
b0b74486
authored
Nov 09, 2011
by
antirez
Browse files
use "EXPIREAT ... ms" form when rewriting the AOF
parent
7dcc10b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/aof.c
View file @
b0b74486
...
...
@@ -608,12 +608,13 @@ int rewriteAppendOnlyFile(char *filename) {
}
/* Save the expire time */
if
(
expiretime
!=
-
1
)
{
char
cmd
[]
=
"*
3
\r\n
$8
\r\n
EXPIREAT
\r\n
"
;
char
cmd
[]
=
"*
4
\r\n
$8
\r\n
EXPIREAT
\r\n
"
;
/* If this key is already expired skip it */
if
(
expiretime
<
now
)
continue
;
if
(
rioWrite
(
&
aof
,
cmd
,
sizeof
(
cmd
)
-
1
)
==
0
)
goto
werr
;
if
(
rioWriteBulkObject
(
&
aof
,
&
key
)
==
0
)
goto
werr
;
if
(
rioWriteBulkLongLong
(
&
aof
,
expiretime
/
1000
)
==
0
)
goto
werr
;
if
(
rioWriteBulkLongLong
(
&
aof
,
expiretime
)
==
0
)
goto
werr
;
if
(
rioWriteBulkString
(
&
aof
,
"ms"
,
2
)
==
0
)
goto
werr
;
}
}
dictReleaseIterator
(
di
);
...
...
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