Commit ce39a670 authored by Ahmad's avatar Ahmad

inikt

parent 8c3f4681
Pipeline #222 canceled with stages
......@@ -120,12 +120,15 @@ async function runCommandOnInstance(instanceIp, username, privateKeyPath) {
conn.end();
return reject(err);
}
// Immediately resolve the promise after sending the command, without waiting for output
stream.on('close', () => {
console.log(`Command sent to ${instanceIp}`);
conn.end();
resolve();
});
// Resolve immediately after sending the command
console.log(`Command sent to ${instanceIp}`);
resolve(); // Resolve immediately to proceed to the next instance
// Optionally close the connection after a brief delay
setTimeout(() => {
conn.end(); // Close the SSH connection after the command is sent
}, 5000); // Adjust the delay as needed
});
}).connect({
host: instanceIp,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment