Ensures to test also the progress update.

This commit is contained in:
Andrea Mazzoleni 2014-11-04 23:51:45 +01:00
parent 61ce847d6a
commit 7054256c62
4 changed files with 16 additions and 3 deletions

View file

@ -4329,7 +4329,9 @@ int state_progress(struct snapraid_state* state, block_off_t blockpos, block_off
pred -= PROGRESS_MAX;
/* if the previous measure is different */
if (state->progress_tick == 0 || state->progress_time[pred] != now) {
if (state->progress_tick == 0
|| state->progress_time[pred] != now
) {
uint64_t tick_total;
uint64_t tick_cpu;
unsigned out_perc = 0;
@ -4345,7 +4347,10 @@ int state_progress(struct snapraid_state* state, block_off_t blockpos, block_off
out_perc = countpos * 100 / countmax;
/* if we have at least 5 measures */
if (state->progress_tick >= 5) {
if (state->progress_tick >= 5
/* or if we are running in test mode, with at least one measure */
|| (state->opt.force_progress && state->progress_tick >= 1)
) {
int oldest;
int past;
time_t delta_time;