Timeout sshkey-gen calls

This commit is contained in:
Nick O'Leary 2018-01-19 12:57:37 +00:00
parent 353de471eb
commit 7e2b2a9a02
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 8 additions and 0 deletions

View File

@ -28,6 +28,13 @@ function runSshKeygenCommand(args,cwd,env) {
var stdout = "";
var stderr = "";
var watchdog = setTimeout(function() {
console.log("TIMEOUT");
console.log("stdout",stdout);
console.log("stderr",stderr);
child.kill();
},6000);
child.stdout.on('data', function(data) {
stdout += data;
});
@ -35,6 +42,7 @@ function runSshKeygenCommand(args,cwd,env) {
stderr += data;
});
child.on('close', function(code, signal) {
clearTimeout(watchdog);
console.log("sshKeyGen closed",code);
console.log("sshKeyGen",stdout);
console.log("sshKeyGen",stderr);