1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

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

View File

@ -28,6 +28,13 @@ function runSshKeygenCommand(args,cwd,env) {
var stdout = ""; var stdout = "";
var stderr = ""; 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) { child.stdout.on('data', function(data) {
stdout += data; stdout += data;
}); });
@ -35,6 +42,7 @@ function runSshKeygenCommand(args,cwd,env) {
stderr += data; stderr += data;
}); });
child.on('close', function(code, signal) { child.on('close', function(code, signal) {
clearTimeout(watchdog);
console.log("sshKeyGen closed",code); console.log("sshKeyGen closed",code);
console.log("sshKeyGen",stdout); console.log("sshKeyGen",stdout);
console.log("sshKeyGen",stderr); console.log("sshKeyGen",stderr);