Initial commit: NetMesh smart ops platform with 3D topology, inspection reports, RCA and AI ops assistant
Some checks failed
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
Some checks failed
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
This commit is contained in:
36
domain/sshConnectionTimeouts.ts
Normal file
36
domain/sshConnectionTimeouts.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import type { Host } from './models.ts';
|
||||
|
||||
export const DEFAULT_SSH_TCP_CONNECT_TIMEOUT_SECONDS = 20;
|
||||
export const DEFAULT_SSH_AUTH_READY_TIMEOUT_SECONDS = 120;
|
||||
export const MAX_SSH_CONNECTION_TIMEOUT_SECONDS = 3600;
|
||||
|
||||
const normalizeTimeoutSeconds = (value: unknown, fallback: number): number => (
|
||||
typeof value === 'number'
|
||||
&& Number.isFinite(value)
|
||||
&& value >= 1
|
||||
&& value <= MAX_SSH_CONNECTION_TIMEOUT_SECONDS
|
||||
? Math.round(value)
|
||||
: fallback
|
||||
);
|
||||
|
||||
export const sanitizeOptionalSshTimeoutSeconds = (value: unknown): number | undefined => (
|
||||
typeof value === 'number'
|
||||
&& Number.isFinite(value)
|
||||
&& value >= 1
|
||||
&& value <= MAX_SSH_CONNECTION_TIMEOUT_SECONDS
|
||||
? Math.round(value)
|
||||
: undefined
|
||||
);
|
||||
|
||||
export const resolveHostSshConnectionTimeouts = (
|
||||
host: Pick<Host, 'sshTcpConnectTimeoutSeconds' | 'sshAuthReadyTimeoutSeconds'>,
|
||||
) => ({
|
||||
tcpConnectTimeoutSeconds: normalizeTimeoutSeconds(
|
||||
host.sshTcpConnectTimeoutSeconds,
|
||||
DEFAULT_SSH_TCP_CONNECT_TIMEOUT_SECONDS,
|
||||
),
|
||||
authReadyTimeoutSeconds: normalizeTimeoutSeconds(
|
||||
host.sshAuthReadyTimeoutSeconds,
|
||||
DEFAULT_SSH_AUTH_READY_TIMEOUT_SECONDS,
|
||||
),
|
||||
});
|
||||
Reference in New Issue
Block a user