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
a906670e
Commit
a906670e
authored
Jul 03, 2011
by
Hampus Wessman
Committed by
antirez
Jul 15, 2011
Browse files
Don't expire keys while loading AOF.
They will be expired (and a DEL will be logged) after the loading is done instead.
parent
d3203c16
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
a906670e
...
...
@@ -455,6 +455,9 @@ int expireIfNeeded(redisDb *db, robj *key) {
if
(
when
<
0
)
return
0
;
/* No expire for this key */
/* Don't expire anything while loading. It will be done later. */
if
(
server
.
loading
)
return
0
;
/* If we are running in the context of a slave, return ASAP:
* the slave key expiration is controlled by the master that will
* send us synthesized DEL operations for expired keys.
...
...
@@ -492,7 +495,7 @@ void expireGenericCommand(redisClient *c, robj *key, robj *param, long offset) {
addReply
(
c
,
shared
.
czero
);
return
;
}
if
(
seconds
<=
0
)
{
if
(
seconds
<=
0
&&
!
server
.
loading
)
{
if
(
dbDelete
(
c
->
db
,
key
))
server
.
dirty
++
;
addReply
(
c
,
shared
.
cone
);
touchWatchedKey
(
c
->
db
,
key
);
...
...
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