feat: Update 2 files
This commit is contained in:
@@ -125,7 +125,7 @@ void list_servers() {
|
|||||||
if (it != server_online_status.end()) {
|
if (it != server_online_status.end()) {
|
||||||
is_online = it->second;
|
is_online = it->second;
|
||||||
} else {
|
} else {
|
||||||
// Quick connectivity check with short timeout (already set to 3s in execute.cpp)
|
// Quick connectivity check
|
||||||
sSSHInfo sshinfo = server_env.get_SSH_INFO(sup.user.user);
|
sSSHInfo sshinfo = server_env.get_SSH_INFO(sup.user.user);
|
||||||
std::string test_cmd = "true";
|
std::string test_cmd = "true";
|
||||||
is_online = execute_ssh_command(sshinfo, sCommand("", test_cmd, {}), cMode::Silent);
|
is_online = execute_ssh_command(sshinfo, sCommand("", test_cmd, {}), cMode::Silent);
|
||||||
|
@@ -165,10 +165,7 @@ namespace dropshell
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::stringstream ssh_cmd;
|
std::stringstream ssh_cmd;
|
||||||
// Add ConnectTimeout to prevent long waits on unreachable servers
|
ssh_cmd << "ssh -p " << ssh_info.get_port() << " "
|
||||||
// Use shorter timeout (3s) for non-interactive, longer (10s) for interactive
|
|
||||||
int timeout = hasFlag(mode, cMode::Interactive) ? 10 : 3;
|
|
||||||
ssh_cmd << "ssh -o ConnectTimeout=" << timeout << " -p " << ssh_info.get_port() << " "
|
|
||||||
<< (hasFlag(mode, cMode::Interactive) ? "-tt " : "")
|
<< (hasFlag(mode, cMode::Interactive) ? "-tt " : "")
|
||||||
<< ssh_info.get_user() << "@" << ssh_info.get_host();
|
<< ssh_info.get_user() << "@" << ssh_info.get_host();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user