exit code retry

This commit is contained in:
tresabhi committed 2026-10-25 13:03:35 -05:00
1 parent a4ee9cf2bd
commit c11285e985
1 file changed
+15 -14
+15 -14
View File
@@ -46,24 +46,25 @@ if (provider === "steam") {
const password = assertSecret(import.meta.env.STEAM_PASSWORD); const password = assertSecret(import.meta.env.STEAM_PASSWORD);
while (true) { while (true) {
try { const result = await $`${
await $`${DEPOT_DOWNLOADER_EXECUTABLE} -os ${ DEPOT_DOWNLOADER_EXECUTABLE
platform } -os ${platform} -app ${id} -username ${
} -app ${id} -username ${username} -password ${ username
password } -password ${password} -dir ${dir} -max-downloads ${
} -dir ${dir} -max-downloads ${DEPOT_DOWNLOADER_MAX_DOWNLOADS}`; DEPOT_DOWNLOADER_MAX_DOWNLOADS
}`.nothrow();
if (result.exitCode === 0) {
console.log("Client downloaded successfully!"); console.log("Client downloaded successfully!");
break; break;
} catch {
console.error(
`DepotDownloader failed. Retrying in ${DEPOT_DOWNLOADER_RETRY_TIME / 1000} seconds...`,
);
await new Promise((resolve) =>
setTimeout(resolve, DEPOT_DOWNLOADER_RETRY_TIME),
);
} }
console.error(
`DepotDownloader failed (exit ${result.exitCode}). Retrying in ${DEPOT_DOWNLOADER_RETRY_TIME / 1000} seconds...`,
);
await new Promise((resolve) =>
setTimeout(resolve, DEPOT_DOWNLOADER_RETRY_TIME),
);
} }
} else if (provider === "zip") { } else if (provider === "zip") {
const url = assertSecret(import.meta.env.CLIENT_SOURCE); const url = assertSecret(import.meta.env.CLIENT_SOURCE);