-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
I spawn a python Process in my Electron App. On the python process runs a Flask server. In my Electron App I spawn the Python process with
const { spawn } = require('child_process');
const treeKill = require('tree-kill');
const path = require('path');
const projectPath = path.join(__dirname, '../');
const pathToPython = path.join(projectPath, '/Venv/Scripts/python');
const pythonOptions = [path.join(projectPath, '/pythonBackend/app.py')];
let ls = spawn(pathToPython, pythonOptions);
I later kill the process with
treeKill(ls.pid);
I can see in the Process Explorer from Microsoft that the tree also gets killed,but after a milisecond, the python process somehow respawns as a standalone process.
If I kill the exact same process tree in the Process Explorer from Windows, then the tree gets killed and there is no crazy respawn of the python process. I don't know why its respawning with the tree-kill module. Any Ideas?
UPDATE
I use now the module tree-kill-promise. https://www.npmjs.com/package/tree-kill-promise This worked for me.
szetakyu
Metadata
Metadata
Assignees
Labels
No labels