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
1c0913dc
Commit
1c0913dc
authored
May 06, 2019
by
WuYunlong
Browse files
Do not active expire keys in the background when the switch is off.
parent
0a6090bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
1c0913dc
...
...
@@ -1674,10 +1674,12 @@ void clientsCron(void) {
void
databasesCron
(
void
)
{
/* Expire keys by random sampling. Not required for slaves
* as master will synthesize DELs for us. */
if
(
server
.
active_expire_enabled
&&
server
.
masterhost
==
NULL
)
{
activeExpireCycle
(
ACTIVE_EXPIRE_CYCLE_SLOW
);
}
else
if
(
server
.
masterhost
!=
NULL
)
{
expireSlaveKeys
();
if
(
server
.
active_expire_enabled
)
{
if
(
server
.
masterhost
==
NULL
)
{
activeExpireCycle
(
ACTIVE_EXPIRE_CYCLE_SLOW
);
}
else
{
expireSlaveKeys
();
}
}
/* Defrag keys gradually. */
...
...
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