@applitools/core 4.37.0-debug-20250429-3 → 4.37.0-debug-20250430-1

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.
@@ -38,6 +38,7 @@ const utils = __importStar(require("@applitools/utils"));
38
38
  const merge_configs_1 = require("./merge-configs");
39
39
  const format_results_1 = require("../utils/format-results");
40
40
  const throat_1 = __importDefault(require("throat"));
41
+ const throttledReadFile = (0, throat_1.default)(Number(process.env.APPLITOOLS_FILE_READING_CONCURRENCY) || 200, fs_1.default.promises.readFile);
41
42
  function getConsoleLogLimit() {
42
43
  var _a;
43
44
  return (_a = utils.general.getEnvValue('OFFLINE_LOG_LIMIT', 'number')) !== null && _a !== void 0 ? _a : 20;
@@ -178,7 +179,7 @@ async function runOfflineSnapshots(options) {
178
179
  async function getCloseSettings(testPath) {
179
180
  const closeSettingsPath = path_1.default.resolve(testPath, 'close.json');
180
181
  if (fs_1.default.existsSync(closeSettingsPath)) {
181
- const fileCloseSettings = await fs_1.default.promises.readFile(closeSettingsPath, 'utf-8').then(JSON.parse);
182
+ const fileCloseSettings = await throttledReadFile(closeSettingsPath, 'utf-8').then(JSON.parse);
182
183
  const closeSettings = (0, merge_configs_1.mergeConfigs)(fileCloseSettings, options.config.close);
183
184
  return closeSettings;
184
185
  }
@@ -228,7 +229,7 @@ async function runOfflineSnapshots(options) {
228
229
  const contentfuleResource = {
229
230
  id: '',
230
231
  url: '',
231
- value: await fs_1.default.promises.readFile(path_1.default.join(offlineLocationPath, 'resources', resource.hash)),
232
+ value: await throttledReadFile(path_1.default.join(offlineLocationPath, 'resources', resource.hash)),
232
233
  contentType: resource.contentType,
233
234
  hash: resource,
234
235
  };
@@ -238,7 +239,7 @@ async function runOfflineSnapshots(options) {
238
239
  resource: {
239
240
  id: '',
240
241
  url: '',
241
- value: await fs_1.default.promises.readFile(path_1.default.join(offlineLocationPath, 'resources', target.snapshot.hash)),
242
+ value: await throttledReadFile(path_1.default.join(offlineLocationPath, 'resources', target.snapshot.hash)),
242
243
  contentType: target.snapshot.contentType,
243
244
  hash: target.snapshot,
244
245
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/core",
3
- "version": "4.37.0-debug-20250429-3",
3
+ "version": "4.37.0-debug-20250430-1",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"