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