scratch-l10n 6.1.122 → 6.1.123

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scratch-l10n",
3
- "version": "6.1.122",
3
+ "version": "6.1.123",
4
4
  "description": "Localization for the Scratch 3.0 components",
5
5
  "main": "./dist/l10n.js",
6
6
  "browser": "./src/index.mjs",
@@ -92,13 +92,21 @@ const TX_UPLOAD_POLL_INTERVAL_MS = 2_000
92
92
  const TX_UPLOAD_TIMEOUT_MS = 5 * 60_000
93
93
  /** Per-request timeout for downloading a resource from the CDN, in milliseconds. */
94
94
  const TX_DOWNLOAD_TIMEOUT_MS = 60_000
95
+ /**
96
+ * How long the Transifex SDK waits between checks on whether a download event's file is ready, in
97
+ * seconds (the SDK's own unit). The SDK sleeps this long before its first check, and files are
98
+ * usually ready within a fraction of a second, so the SDK's 5-second default dominates a bulk pull.
99
+ */
100
+ const TX_DOWNLOAD_POLL_INTERVAL_S = 0.25
95
101
  /**
96
102
  * Maximum number of Transifex download events to create concurrently. Each `txPull` creates a
97
103
  * download event (a rate-limited API call); fanning every (resource, locale) pair out at once
98
104
  * overruns the API's throttle. Bounding the create step keeps a bulk pull under the limit while
99
- * still overlapping enough requests to make progress.
105
+ * still overlapping enough requests to make progress. With the short poll interval, 8 pulls all of
106
+ * scratch-website (3,840 files) in about 10 minutes without a single 429; 16 is only about 2 minutes
107
+ * faster and gets throttled on every run.
100
108
  */
101
- const TX_MAX_CONCURRENT_DOWNLOADS = 4
109
+ const TX_MAX_CONCURRENT_DOWNLOADS = 8
102
110
  /** Upper bound on how long to honor a throttle's "expected available" hint before giving up on it. */
103
111
  const TX_MAX_THROTTLE_WAIT_MS = 120_000
104
112
 
@@ -302,6 +310,7 @@ const getResourceLocation = async function (
302
310
  // if locale is English, create a download event of the source file
303
311
  if (localeCode === SOURCE_LOCALE) {
304
312
  return (await transifexApi.ResourceStringsAsyncDownload.download({
313
+ interval: TX_DOWNLOAD_POLL_INTERVAL_S,
305
314
  resource,
306
315
  })) as string
307
316
  }
@@ -315,6 +324,7 @@ const getResourceLocation = async function (
315
324
 
316
325
  // if locale is not English, create a download event of the translation file
317
326
  return (await transifexApi.ResourceTranslationsAsyncDownload.download({
327
+ interval: TX_DOWNLOAD_POLL_INTERVAL_S,
318
328
  mode,
319
329
  resource,
320
330
  language,