mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-27 04:29:50 +01:00
retry time
This commit is contained in:
1 parent
ac673cd47f
commit
40b732803e
1 file changed
+22
-5
@@ -9,6 +9,8 @@ import {
|
|||||||
} from "./constants";
|
} from "./constants";
|
||||||
import { QuickGitHubRelease } from "./types";
|
import { QuickGitHubRelease } from "./types";
|
||||||
|
|
||||||
|
const DEPOT_DOWNLOADER_RETRY_TIME = 30_000;
|
||||||
|
|
||||||
const provider = assertSecret(import.meta.env.CLIENT_PROVIDER);
|
const provider = assertSecret(import.meta.env.CLIENT_PROVIDER);
|
||||||
const source = assertSecret(import.meta.env.CLIENT_SOURCE);
|
const source = assertSecret(import.meta.env.CLIENT_SOURCE);
|
||||||
const dir = assertSecret(import.meta.env.CLIENT_DIR);
|
const dir = assertSecret(import.meta.env.CLIENT_DIR);
|
||||||
@@ -43,11 +45,26 @@ if (provider === "steam") {
|
|||||||
const username = assertSecret(import.meta.env.STEAM_USERNAME);
|
const username = assertSecret(import.meta.env.STEAM_USERNAME);
|
||||||
const password = assertSecret(import.meta.env.STEAM_PASSWORD);
|
const password = assertSecret(import.meta.env.STEAM_PASSWORD);
|
||||||
|
|
||||||
await $`${DEPOT_DOWNLOADER_EXECUTABLE} -os ${
|
while (true) {
|
||||||
platform
|
try {
|
||||||
} -app ${id} -username ${username} -password ${
|
await $`${DEPOT_DOWNLOADER_EXECUTABLE} -os ${
|
||||||
password
|
platform
|
||||||
} -dir ${dir} -max-downloads ${DEPOT_DOWNLOADER_MAX_DOWNLOADS}`;
|
} -app ${id} -username ${username} -password ${
|
||||||
|
password
|
||||||
|
} -dir ${dir} -max-downloads ${DEPOT_DOWNLOADER_MAX_DOWNLOADS}`;
|
||||||
|
|
||||||
|
console.log("Client downloaded successfully!");
|
||||||
|
break;
|
||||||
|
} catch {
|
||||||
|
console.error(
|
||||||
|
`DepotDownloader failed. 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