Open nossila opened 6 years ago
If you refer to the official docs, you'll notice that there is no function kill
available for node processes.
Use nodeProcess.stop()
instead. It will try to stop the process gracefully first. If that won't work, Desktop will kill the process.
Once Desktop is closed - all subprocesses (neo4j, java, node) are being stopped automatically. I like the idea of stopping processes populated by the graph app once the window is closed.
The Process
object have a nodeProcess
key which have a kill
function, that's what I was using, I forgot to mention that. I updated my code to use nodeProcess.stop()
instead since this is the recommended one but the behavior looks the same, process is stopped for reloading but don't stop when closing the app.
@nossila what would be the expected Desktop behaviour then? Closing a graph app window stops all populated processes? Or those processes should continue running in the background, but then Desktop would give a descriptor for each running background process once you open the graph app again?
@Metaur as an user I would like to be able to free all resources used by an app when closing it, so I would vote for stopping the processes when closing their parent graph app.
How can I kill the process when the user closes the app?
I tried to do something like:
I see this working when reloading the app, but when closing the my app window the process don't get killed, I need to close Neo4j Desktop for it to get killed.
Maybe Neo4j Desktop should by default kill any process started by an app when this app gets closed.