fix: keep active ssh downloads alive
This commit is contained in:
@@ -1679,25 +1679,28 @@ function combineCommandResults(command: string[], parts: CommandResult[]): Comma
|
||||
}
|
||||
|
||||
function downloadRemoteFile(options: ArtifactRegistryOptions, remotePath: string, localPath: string, timeoutMs = options.timeoutMs): CommandResult {
|
||||
const transferRuntimeTimeoutMs = Math.max(timeoutMs * 4, 60 * 60_000);
|
||||
const command = [
|
||||
process.execPath,
|
||||
"scripts/cli.ts",
|
||||
"ssh",
|
||||
options.providerId,
|
||||
"download",
|
||||
"--inactivity-timeout-ms",
|
||||
String(timeoutMs),
|
||||
remotePath,
|
||||
localPath,
|
||||
];
|
||||
const stdoutFile = process.env.UNIDESK_JOB_STDOUT_FILE;
|
||||
const stderrFile = process.env.UNIDESK_JOB_STDERR_FILE;
|
||||
if (!stdoutFile || !stderrFile) return runCommand(command, repoRoot, { timeoutMs });
|
||||
if (!stdoutFile || !stderrFile) return runCommand(command, repoRoot, { timeoutMs: transferRuntimeTimeoutMs });
|
||||
return runCommand([
|
||||
"bash",
|
||||
"-lc",
|
||||
`set -o pipefail; "$@" > >(tee -a ${shellQuote(stdoutFile)}) 2> >(tee -a ${shellQuote(stderrFile)} >&2)`,
|
||||
"unidesk-artifact-download",
|
||||
...command,
|
||||
], repoRoot, { timeoutMs });
|
||||
], repoRoot, { timeoutMs: transferRuntimeTimeoutMs });
|
||||
}
|
||||
|
||||
async function runRemoteScriptBackground(
|
||||
|
||||
Reference in New Issue
Block a user