From 9bc753b51263aa68e18a99ff4ee2f5ca4418070f Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 9 Aug 2026 14:39:05 -0500 Subject: [PATCH] i was going to add verification but eh, no right now... --- packages/scripts/src/discoverIds/index.ts | 29 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/packages/scripts/src/discoverIds/index.ts b/packages/scripts/src/discoverIds/index.ts index fff3e09ac..59d436569 100644 --- a/packages/scripts/src/discoverIds/index.ts +++ b/packages/scripts/src/discoverIds/index.ts @@ -179,8 +179,6 @@ async function save() { process.on("SIGINT", save); process.on("SIGTERM", save); -console.log("Starting discovery loop..."); - const queue: { region: RegionDescriptor; url: string; size: number }[] = []; const applicationId = import.meta.env.PUBLIC_WARGAMING_APPLICATION_ID; const fields = "account_id%2C-account_id"; @@ -227,7 +225,13 @@ function sleep() { return new Promise((resolve) => setTimeout(resolve, 1000 / API_RATE)); } -while (performance.now() < t1 && regions.length > 0) { +function withinTimeLimit() { + return performance.now() < t1; +} + +console.log("Starting discovery loop..."); + +while (withinTimeLimit() && regions.length > 0) { await sleep(); fillQueue(); @@ -271,4 +275,23 @@ while (performance.now() < t1 && regions.length > 0) { } } +// console.log("Starting verification loop..."); + +// while (withinTimeLimit()) { +// const verificationIndex = (manifest.last_verified + 1) % manifest.chunks; +// manifest.last_verified = verificationIndex; +// const chunk = chunks[verificationIndex]; +// const size = chunk.size(); + +// let i0 = 0; +// while (withinTimeLimit() && i0 < size) { +// await sleep(); + +// const i1 = Math.min(i0 + MAX_IDS_PER_CALL - 1, size - 1); +// const indices = range(i0, i1 + 1); +// } + +// console.log(`Verification complete for chunk ${verificationIndex}`); +// } + await save();