Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Oct 29, 2024
1 parent ecbaa7a commit 85bd85a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/plugin-assets-retry/src/runtime/asyncChunkRetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function getNextRetryUrl(
}

// shared between ensureChunk and loadScript
let globalCurrRetrying: Retry | undefined = undefined;
const globalCurrRetrying: Record<ChunkId, Retry> = {};
function getCurrentRetry(
chunkId: string,
existRetryTimes: number,
Expand Down Expand Up @@ -182,7 +182,7 @@ function nextRetry(chunkId: string, existRetryTimes: number): Retry {
}

retryCollector[chunkId][nextExistRetryTimes] = nextRetry;
globalCurrRetrying = nextRetry;
globalCurrRetrying[chunkId] = nextRetry;
return nextRetry;
}

Expand Down Expand Up @@ -299,7 +299,7 @@ function loadScript(
key: string,
chunkId: ChunkId,
) {
const retry = globalCurrRetrying;
const retry = globalCurrRetrying[chunkId];
return originalLoadScript(
retry ? retry.nextRetryUrl : originalUrl,
done,
Expand Down

0 comments on commit 85bd85a

Please sign in to comment.