Respect lockOverride when using withLock

This commit is contained in:
Felipe Lalanne 2024-11-27 13:49:14 -03:00
parent 9c09329b86
commit 8b3b9a5b7b
No known key found for this signature in database
GPG Key ID: 03E696BFD472B26A
2 changed files with 4 additions and 2 deletions

View File

@ -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 },
); );
} }

View File

@ -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 },
); );
} }
} }