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
bc7076b0
Commit
bc7076b0
authored
Nov 18, 2017
by
zhaozhao.zz
Committed by
antirez
Nov 21, 2017
Browse files
rehash: handle one db until finished
parent
7675b00a
Changes
1
Show whitespace changes
Inline
Side-by-side
src/server.c
View file @
bc7076b0
...
@@ -908,12 +908,15 @@ void databasesCron(void) {
...
@@ -908,12 +908,15 @@ void databasesCron(void) {
/* Rehash */
/* Rehash */
if
(
server
.
activerehashing
)
{
if
(
server
.
activerehashing
)
{
for
(
j
=
0
;
j
<
dbs_per_call
;
j
++
)
{
for
(
j
=
0
;
j
<
dbs_per_call
;
j
++
)
{
int work_done = incrementallyRehash(rehash_db % server.dbnum);
int
work_done
=
incrementallyRehash
(
rehash_db
);
rehash_db++;
if
(
work_done
)
{
if
(
work_done
)
{
/* If the function did some work, stop here, we'll do
/* If the function did some work, stop here, we'll do
* more at the next cron loop. */
* more at the next cron loop. */
break
;
break
;
}
else
{
/* If this db didn't need rehash, we'll try the next one. */
rehash_db
++
;
rehash_db
%=
server
.
dbnum
;
}
}
}
}
}
}
...
...
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