FishingHacks/qrunner

kill() does not kill correctly

FishingHacks opened this issue · 3 comments

when invoking kill(), it does not kill the child process correctly. This is because the child process is a terminal provider, which invokes ts-node or tsx, which in turn invoke other processes. All these processes dont get killed when the main process gets killed.

Solution:
Precompile the scripts on change using esbuild, so that we just launch node, which we can then kill

Fixed on Linux by spawning with shell just on windows

fixed by using esbuild for compilation on file-change and using fork(...) when running a script.

TODO: Display error when compilation failed

finished todo with commit 4fbc2bd