shell: rename signal to abortSignal

this prevents accidental typos with child_process signal handling
This commit is contained in:
Girish Ramakrishnan
2025-07-17 09:50:43 +02:00
parent 38032f0b77
commit 5e1c32b606
3 changed files with 16 additions and 12 deletions

View File

@@ -179,9 +179,13 @@ async function startTask(id, options) {
}, options.timeout);
}
const sudoOptions = { preserveEnv: true, signal: ac.signal };
const sudoArgs = [ START_TASK_CMD, id, logFile, options.nice || 0, options.memoryLimit || 400, options.oomScoreAdjust || 0 ];
const sudoOptions = {
preserveEnv: true,
abortSignal: ac.signal,
};
const [sudoError] = await safe(shell.sudo([ START_TASK_CMD, id, logFile, options.nice || 0, options.memoryLimit || 400, options.oomScoreAdjust || 0 ], sudoOptions));
const [sudoError] = await safe(shell.sudo(sudoArgs, sudoOptions));
const code = sudoError ? sudoError.code : 0;
debug(`startTask: ${id} completed with code ${code} ${!gTasks[id] ? '. this will be ignored' : ''}`);