Skip to content

Commit

Permalink
forgot to mark running as false in restart method
Browse files Browse the repository at this point in the history
  • Loading branch information
Almenon committed Oct 24, 2017
1 parent c83a1c1 commit de9e7ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/evaluators.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ module.exports.PythonEvaluator = class{
// (pyshell callback only happens when process exits voluntarily)
this.pyshell.childProcess.on('exit',()=>{
restarting = true
this.running = false
this.startPython()
})

// pyshell has 50 ms to die gracefully
var dead = this.pyshell.childProcess.kill()
if(!dead) console.info("pyshell refused to die")
else this.running = false

setTimeout(()=>{
if(!dead && !restarting){
Expand All @@ -82,6 +84,7 @@ module.exports.PythonEvaluator = class{
if(!dead){
console.error("the python process simply cannot be killed!")
}
else this.running = false
}
}, 50)
}
Expand Down

0 comments on commit de9e7ac

Please sign in to comment.