From 4bfb87e5c7ef5e40d017ccfcf7de1bdc1dbe9624 Mon Sep 17 00:00:00 2001 From: hstyi Date: Tue, 19 Aug 2025 16:56:41 +0800 Subject: [PATCH] fix: connection timeout --- src/main/kotlin/app/termora/plugin/internal/ssh/SshClients.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/kotlin/app/termora/plugin/internal/ssh/SshClients.kt b/src/main/kotlin/app/termora/plugin/internal/ssh/SshClients.kt index 2bcaa88..8bd64a6 100644 --- a/src/main/kotlin/app/termora/plugin/internal/ssh/SshClients.kt +++ b/src/main/kotlin/app/termora/plugin/internal/ssh/SshClients.kt @@ -425,8 +425,11 @@ object SshClients { val heartbeatInterval = max(host.options.heartbeatInterval, 3) + val timeout = Duration.ofSeconds(host.options.extras["timeout"]?.toLongOrNull() ?: 60) + CoreModuleProperties.HEARTBEAT_INTERVAL.set(sshClient, Duration.ofSeconds(heartbeatInterval.toLong())) CoreModuleProperties.ALLOW_DHG1_KEX_FALLBACK.set(sshClient, true) + CoreModuleProperties.IO_CONNECT_TIMEOUT.set(sshClient, timeout) sshClient.setKeyPasswordProviderFactory { IdentityPasswordProvider(CredentialsProvider.getDefault()) }