mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-18 21:27:54 +00:00
Respect lockOverride when using withLock
This commit is contained in:
parent
9c09329b86
commit
8b3b9a5b7b
@ -455,6 +455,7 @@ export async function shutdown({
|
||||
// Get current apps to create locks for
|
||||
const apps = await applicationManager.getCurrentApps();
|
||||
const appIds = Object.keys(apps).map((strId) => parseInt(strId, 10));
|
||||
const lockOverride = await config.get('lockOverride');
|
||||
// Try to create a lock for all the services before shutting down
|
||||
return updateLock.withLock(
|
||||
appIds,
|
||||
@ -474,7 +475,7 @@ export async function shutdown({
|
||||
emitAsync('shutdown', undefined);
|
||||
return dbusAction;
|
||||
},
|
||||
{ force },
|
||||
{ force: force || lockOverride },
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -103,6 +103,7 @@ export async function patch(
|
||||
const { noProxy, ...targetConf } = conf.network.proxy;
|
||||
// It's possible for appIds to be an empty array, but patch shouldn't fail
|
||||
// as it's not dependent on there being any running user applications.
|
||||
const lockOverride = await config.get('lockOverride');
|
||||
return updateLock.withLock(
|
||||
appIds,
|
||||
async () => {
|
||||
@ -124,7 +125,7 @@ export async function patch(
|
||||
);
|
||||
await setProxy(patchedConf, noProxy);
|
||||
},
|
||||
{ force },
|
||||
{ force: force || lockOverride },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user