mirror of
https://github.com/fluencelabs/redis
synced 2025-06-21 04:51:32 +00:00
INFO loading stats: three fixes.
1. Server unxtime may remain not updated while loading AOF, so ETA is not updated correctly. 2. Number of processed byte was not initialized. 3. Possible division by zero condition (likely cause of issue #1932).
This commit is contained in:
@ -1087,8 +1087,9 @@ void startLoading(FILE *fp) {
|
||||
/* Load the DB */
|
||||
server.loading = 1;
|
||||
server.loading_start_time = time(NULL);
|
||||
server.loading_loaded_bytes = 0;
|
||||
if (fstat(fileno(fp), &sb) == -1) {
|
||||
server.loading_total_bytes = 1; /* just to avoid division by zero */
|
||||
server.loading_total_bytes = 0;
|
||||
} else {
|
||||
server.loading_total_bytes = sb.st_size;
|
||||
}
|
||||
|
Reference in New Issue
Block a user