Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
eea15afe
Commit
eea15afe
authored
Dec 30, 2010
by
antirez
Browse files
fixed bugs on diskstore cache
parent
1fce3201
Changes
1
Show whitespace changes
Inline
Side-by-side
src/dscache.c
View file @
eea15afe
...
...
@@ -471,7 +471,7 @@ void cacheScheduleForFlush(redisDb *db, robj *key) {
dk
->
key
=
key
;
incrRefCount
(
key
);
dk
->
ctime
=
time
(
NULL
);
listAddNodeTail
(
server
.
cache_flush_queue
,
k
ey
);
listAddNodeTail
(
server
.
cache_flush_queue
,
d
k
);
}
void
cacheCron
(
void
)
{
...
...
@@ -488,8 +488,10 @@ void cacheCron(void) {
redisLog
(
REDIS_DEBUG
,
"Creating IO Job to save key %s"
,
dk
->
key
->
ptr
);
/* Lookup the key. We need to check if it's still here and
* possibly access to the value. */
/* Lookup the key, in order to put the current value in the IO
* Job and mark ti as DS_SAVING.
* Otherwise if the key does not exists we schedule a disk store
* delete operation, setting the value to NULL. */
de
=
dictFind
(
dk
->
db
->
dict
,
dk
->
key
->
ptr
);
if
(
de
)
{
val
=
dictGetEntryVal
(
de
);
...
...
@@ -502,6 +504,8 @@ void cacheCron(void) {
}
dsCreateIOJob
(
REDIS_IOJOB_SAVE
,
dk
->
db
,
dk
->
key
,
val
);
listDelNode
(
server
.
cache_flush_queue
,
ln
);
decrRefCount
(
dk
->
key
);
zfree
(
dk
);
}
else
{
break
;
/* too early */
}
...
...
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