Set applyInProgress to true while applying intermediate state

Intermediate state is utilized when executing device actions such as a
volume purge. It's a type of state apply, but despite that,
applyInProgress is not true.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
This commit is contained in:
Christina Ying Wang 2023-10-25 10:32:10 -07:00
parent 06cf939958
commit a993b3e7af

View File

@ -890,6 +890,7 @@ export async function applyIntermediateTarget(
return pausingApply(async () => {
// TODO: Make sure we don't accidentally overwrite this
intermediateTarget = intermediate;
applyInProgress = true;
return applyTarget({
intermediate: true,
force,
@ -897,6 +898,7 @@ export async function applyIntermediateTarget(
keepVolumes,
}).then(() => {
intermediateTarget = null;
applyInProgress = false;
});
});
}