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
34f6d947
Unverified
Commit
34f6d947
authored
May 10, 2019
by
Salvatore Sanfilippo
Committed by
GitHub
May 10, 2019
Browse files
Merge pull request #6074 from trevor211/fixActiveExpire
Do not active expire keys in the background when the switch is off.
parents
1e9b8d85
1c0913dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
34f6d947
...
...
@@ -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