mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 19:49:50 +01:00
exit code retry
This commit is contained in:
1 parent
a4ee9cf2bd
commit
c11285e985
1 file changed
+15
-14
@@ -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);
|
||||||
|
|||||||
Reference in new issue
Block a user