perf(cliproxy): overlap gemini quota metadata fetches

This commit is contained in:
Tam Nhu Tran committed 2026-04-03 19:56:31 -04:00
1 parent 71c4b184f9
commit c9bbc58dd4
2 files changed
+43 -5

No files matched your search

+6 -5
View File
@@ -639,6 +639,11 @@ async function fetchWithAuthData(
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 5000);
const supplementaryPromise = fetchGeminiCliSupplementary(
authData.accessToken,
authData.projectId,
verbose
);
try {
const response = await fetch(GEMINI_CLI_QUOTA_URL, {
@@ -668,11 +673,7 @@ async function fetchWithAuthData(
const data = (await response.json()) as GeminiCliQuotaResponse;
const rawBuckets = data.buckets || [];
const buckets = buildGeminiCliBuckets(rawBuckets);
const supplementary = await fetchGeminiCliSupplementary(
authData.accessToken,
authData.projectId,
verbose
);
const supplementary = await supplementaryPromise;
if (verbose) console.error(`[i] Gemini CLI buckets found: ${buckets.length}`);