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
5877c02c
Commit
5877c02c
authored
Jun 13, 2017
by
antirez
Browse files
Fix PERSIST expired key resuscitation issue #4048.
parent
e91b81c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
5877c02c
...
...
@@ -93,7 +93,7 @@ robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags) {
if
(
expireIfNeeded
(
db
,
key
)
==
1
)
{
/* Key expired. If we are in the context of a master, expireIfNeeded()
* returns 0 only when the key does not exist at all, so it's sa
v
e
* returns 0 only when the key does not exist at all, so it's sa
f
e
* to return NULL ASAP. */
if
(
server
.
masterhost
==
NULL
)
return
NULL
;
...
...
src/expire.c
View file @
5877c02c
...
...
@@ -477,18 +477,15 @@ void pttlCommand(client *c) {
/* PERSIST key */
void
persistCommand
(
client
*
c
)
{
dictEntry
*
de
;
de
=
dictFind
(
c
->
db
->
dict
,
c
->
argv
[
1
]
->
ptr
);
if
(
de
==
NULL
)
{
addReply
(
c
,
shared
.
czero
);
}
else
{
if
(
lookupKeyWrite
(
c
->
db
,
c
->
argv
[
1
]))
{
if
(
removeExpire
(
c
->
db
,
c
->
argv
[
1
]))
{
addReply
(
c
,
shared
.
cone
);
server
.
dirty
++
;
}
else
{
addReply
(
c
,
shared
.
czero
);
}
}
else
{
addReply
(
c
,
shared
.
czero
);
}
}
...
...
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