Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
getnamo committed Aug 2, 2019
1 parent 4aaf0f7 commit d90e9ff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
29 changes: 18 additions & 11 deletions Content/Scripts/scriptHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,24 @@ const stopScript = (processInfo, callback)=>{
setTimeout(()=>{
//graceful exit didn't work, try disconnecting
try{
processInfo.child.disconnect();
callback(null, processId);

//disconnect didn't work, send SIGINT
setTimeout(()=>{
if(ipc.isRunning){
console.log('Still running, forcefully ending ' + processId);
processInfo.child.kill('SIGINT');
//console.log(processInfo);
}
}, 50)
if(ipc.isRunning){
processInfo.child.disconnect();

//disconnect didn't work, send SIGINT
setTimeout(()=>{
if(ipc.isRunning){
console.log('Still running, forcefully ending ' + processId);
processInfo.child.kill('SIGINT');
//console.log(processInfo);
}
//either way we definitely stopped
callback(null, processId);
}, 50);
}
else
{
callback(null, processId);
}
}
catch(e){
callback('script disconnect error: ' + util.inspect(e));
Expand Down
2 changes: 1 addition & 1 deletion Source/CommandLine/Private/NodeCmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ FNodeCmd::FNodeCmd()
bIsWatchingScript = false;

//swap this to debug main script with an external local server, otherwise crashes will be relatively opaque
bUseRemoteMainScript = false;
bUseRemoteMainScript = true;
}

FNodeCmd::~FNodeCmd()
Expand Down

0 comments on commit d90e9ff

Please sign in to comment.