mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Abort cooldown sleep and break caller loops immediately on interruption
This commit is contained in:
parent
ea955eedc7
commit
f9819266e7
5 changed files with 14 additions and 2 deletions
|
|
@ -2313,7 +2313,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna
|
|||
/* progress */
|
||||
if (state_progress(state, 0, i, countpos, countmax, countsize)) {
|
||||
/* LCOV_EXCL_START */
|
||||
break;
|
||||
goto end;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
|
|
@ -2330,6 +2330,9 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna
|
|||
|
||||
/* drop until now */
|
||||
state_usage_waste(state);
|
||||
|
||||
if (os_signal_interrupt())
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -352,6 +352,9 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit
|
|||
|
||||
/* drop until now */
|
||||
state_usage_waste(state);
|
||||
|
||||
if (os_signal_interrupt())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -931,6 +931,9 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par
|
|||
|
||||
/* drop until now */
|
||||
state_usage_waste(state);
|
||||
|
||||
if (os_signal_interrupt())
|
||||
break;
|
||||
}
|
||||
|
||||
/* autosave */
|
||||
|
|
|
|||
|
|
@ -1692,6 +1692,9 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
|
||||
/* drop until now */
|
||||
state_usage_waste(state);
|
||||
|
||||
if (os_signal_interrupt())
|
||||
break;
|
||||
}
|
||||
|
||||
/* autosave */
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ void state_thermal_cooldown(struct snapraid_state* state)
|
|||
log_flush();
|
||||
|
||||
/* every 30 seconds spin down any disk that was spunup */
|
||||
while (sleep_time > 0) {
|
||||
while (sleep_time > 0 && !os_signal_interrupt()) {
|
||||
state_device(state, DEVICE_DOWNIFUP, 0);
|
||||
|
||||
sleep(30);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue