Skip to content

Commit 22c482d

Browse files
committed
fix(i18n): never sleep past the batch wait deadline
1 parent 2eb5f2e commit 22c482d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lib/i18n/batch.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ export async function prefetchTranslations(
283283
)
284284
break
285285
}
286-
await sleep(opts.pollMs)
286+
await sleep(Math.min(opts.pollMs, Math.max(0, deadline - now())))
287287
}
288288

289289
const pending = new Set<string>()

0 commit comments

Comments
 (0)