Skip to content

Commit

Permalink
Fig bug when killing process
Browse files Browse the repository at this point in the history
  • Loading branch information
rbarreror committed Nov 24, 2020
1 parent b625ba5 commit 0ec6f86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion desktopApp/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const nCores = Number((os.cpus().length*0.5).toFixed(0)); // Number of cores use

var win; // Windows openned (the only one)
var batch; // Process spawned when running workflow
var killed = false; // Variable used to know if user killed running process

const index = path.join('file://', __dirname, 'index.html');
const moduleSelector = path.join('file://', __dirname, 'sections', 'execute', 'moduleSelector.html');
Expand Down Expand Up @@ -63,6 +64,7 @@ app.on('window-all-closed', () => {
// if batch.exitCode is null, spawned process is still running. In that case, kill the process

if (process.platform == "win32") {
killed = true;
spawnSync("TASKKILL", ["/F", "/T", "/PID", batch.pid]);
} else if (process.platform == "linux") {
app.exit(99)
Expand Down Expand Up @@ -279,7 +281,8 @@ function runWorkflow (osType, modulesString, infile_user, workflowPath, infile_f
e.reply('send-jobID', workflow);
});

} else {
} else if (!killed) {

// Else, an error occurred
var statusCode = code.toString();

Expand Down

0 comments on commit 0ec6f86

Please sign in to comment.