Skip to content

Commit f98956b

Browse files
committed
Merge branch 'master' into trevj-promise-retry-timeout
2 parents c769f27 + 486ca2f commit f98956b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cloud/install/installer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ const STATUS_PREFIX = 'CLOUD_INSTALL_STATUS';
3030
const INITIAL_CONNECTION_INTERVAL_MS = 500;
3131
const MAX_CONNECTION_INTERVAL_MS = 10000;
3232

33+
// Timeouts for established SSH connections.
34+
// We define these chiefly so that the installer fails quickly
35+
// in case the server is destroyed during installation, e.g.
36+
// when the user cancels install.
37+
const KEEPALIVE_INTERVAL_MS = 1000;
38+
const KEEPALIVE_MAX_FAILURES = 5;
39+
3340
// Installs uProxy on a server, via SSH.
3441
// The process is as close as possible to a manual install
3542
// so that we have fewer paths to test.
@@ -49,6 +56,8 @@ class CloudInstaller {
4956
port: port,
5057
username: username,
5158
privateKey: key,
59+
keepaliveInterval: KEEPALIVE_INTERVAL_MS,
60+
keepaliveCountMax: KEEPALIVE_MAX_FAILURES,
5261
// Remaining fields only for type-correctness.
5362
tryKeyboard: false,
5463
debug: undefined

0 commit comments

Comments
 (0)