mirror of
https://github.com/fluencelabs/redis
synced 2025-04-25 10:32:14 +00:00
rehash: handle one db until finished
This commit is contained in:
parent
bab437bef3
commit
fd5f229ff0
@ -1056,12 +1056,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user