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
360664c9
Commit
360664c9
authored
Jan 14, 2011
by
antirez
Browse files
master-slave replication fixed, it was not listing any key using KEYS command in the slave.
parent
f487bbbf
Changes
1
Show whitespace changes
Inline
Side-by-side
src/db.c
View file @
360664c9
...
@@ -453,6 +453,8 @@ void propagateExpire(redisDb *db, robj *key) {
...
@@ -453,6 +453,8 @@ void propagateExpire(redisDb *db, robj *key) {
int
expireIfNeeded
(
redisDb
*
db
,
robj
*
key
)
{
int
expireIfNeeded
(
redisDb
*
db
,
robj
*
key
)
{
time_t
when
=
getExpire
(
db
,
key
);
time_t
when
=
getExpire
(
db
,
key
);
if
(
when
<
0
)
return
0
;
/* No expire for this key */
/* If we are running in the context of a slave, return ASAP:
/* If we are running in the context of a slave, return ASAP:
* the slave key expiration is controlled by the master that will
* the slave key expiration is controlled by the master that will
* send us synthesized DEL operations for expired keys.
* send us synthesized DEL operations for expired keys.
...
@@ -464,8 +466,6 @@ int expireIfNeeded(redisDb *db, robj *key) {
...
@@ -464,8 +466,6 @@ int expireIfNeeded(redisDb *db, robj *key) {
return
time
(
NULL
)
>
when
;
return
time
(
NULL
)
>
when
;
}
}
if
(
when
<
0
)
return
0
;
/* Return when this key has not expired */
/* Return when this key has not expired */
if
(
time
(
NULL
)
<=
when
)
return
0
;
if
(
time
(
NULL
)
<=
when
)
return
0
;
...
...
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