api: write stdin to child process
This commit is contained in:
parent
2505b89fcf
commit
9d32012bbc
|
@ -93,12 +93,15 @@ class Job {
|
||||||
detached: true //dont kill the main process when we kill the group
|
detached: true //dont kill the main process when we kill the group
|
||||||
});
|
});
|
||||||
|
|
||||||
|
proc.stdin.write(this.stdin);
|
||||||
|
proc.stdin.end();
|
||||||
|
|
||||||
|
|
||||||
const kill_timeout = setTimeout(_ => proc.kill('SIGKILL'), timeout);
|
const kill_timeout = setTimeout(_ => proc.kill('SIGKILL'), timeout);
|
||||||
|
|
||||||
proc.stderr.on('data', d=>{if(stderr.length>config.output_max_size) proc.kill('SIGKILL'); else stderr += d;});
|
proc.stderr.on('data', d=>{if(stderr.length>config.output_max_size) proc.kill('SIGKILL'); else stderr += d;});
|
||||||
proc.stdout.on('data', d=>{if(stdout.length>config.output_max_size) proc.kill('SIGKILL'); else stdout += d;});
|
proc.stdout.on('data', d=>{if(stdout.length>config.output_max_size) proc.kill('SIGKILL'); else stdout += d;});
|
||||||
|
|
||||||
function exit_cleanup(){
|
function exit_cleanup(){
|
||||||
clearTimeout(kill_timeout);
|
clearTimeout(kill_timeout);
|
||||||
proc.stderr.destroy();
|
proc.stderr.destroy();
|
||||||
|
|
Loading…
Reference in New Issue