diff --git a/electron/main.js b/electron/main.js index 5a8496126..1a8420e4a 100644 --- a/electron/main.js +++ b/electron/main.js @@ -24,7 +24,7 @@ const { OperateCmd, OperateDirectory, } = require('./install'); -const { killProcessAndChildren } = require('./processes'); +const { killProcesses } = require('./processes'); // Attempt to acquire the single instance lock const singleInstanceLock = app.requestSingleInstanceLock(); @@ -58,7 +58,7 @@ let tray, async function beforeQuit() { if (operateDaemonPid) { try { - await killProcessAndChildren(operateDaemonPid); + await killProcesses(operateDaemonPid); } catch (e) { console.error(e); } @@ -66,7 +66,7 @@ async function beforeQuit() { if (nextAppProcessPid) { try { - await killProcessAndChildren(nextAppProcessPid); + await killProcesses(nextAppProcessPid); } catch (e) { console.error(e); } diff --git a/electron/processes.js b/electron/processes.js index 5f5c01b7f..e67dcaac5 100644 --- a/electron/processes.js +++ b/electron/processes.js @@ -6,7 +6,7 @@ const windowsKillCommand = 'taskkill /F /PID'; const isWindows = process.platform === 'win32'; -function killProcessAndChildren(pid) { +function killProcesses(pid) { return new Promise((resolve, reject) => { psTree(pid, (err, children) => { if (err) { @@ -37,4 +37,4 @@ function killProcessAndChildren(pid) { }); } -module.exports = { killProcessAndChildren }; +module.exports = { killProcesses };