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:
parent
353de471eb
commit
7e2b2a9a02
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user