diff --git a/packages/client/src/client.js b/packages/client/src/client.js index 7bee9cce5..6e8beca41 100644 --- a/packages/client/src/client.js +++ b/packages/client/src/client.js @@ -367,6 +367,7 @@ export class PercyClient { validateId('build', buildId); this.log.debug(`Uploading resources for ${buildId}...`, meta); + const uploadConcurrency = parseInt(process.env.PERCY_RESOURCE_UPLOAD_CONCURRENCY) || 2; return pool(function*() { for (let resource of resources) { let resourceMeta = { @@ -377,7 +378,7 @@ export class PercyClient { yield this.uploadResource(buildId, resource, resourceMeta); this.log.debug(`Uploaded resource ${resource.url}`, resourceMeta); } - }, this, 2); + }, this, uploadConcurrency); } // Creates a snapshot for the active build using the provided attributes. diff --git a/packages/core/src/discovery.js b/packages/core/src/discovery.js index 03c7c51c4..66faeeae9 100644 --- a/packages/core/src/discovery.js +++ b/packages/core/src/discovery.js @@ -429,7 +429,12 @@ export function createDiscoveryQueue(percy) { } return resource; }, - saveResource: r => { snapshot.resources.set(r.url, r); cache.set(r.url, r); } + saveResource: r => { + snapshot.resources.set(r.url, r); + if (!snapshot.discovery.disableCache) { + cache.set(r.url, r); + } + } } }); diff --git a/packages/core/src/percy.js b/packages/core/src/percy.js index 1dcecfa99..61268a558 100644 --- a/packages/core/src/percy.js +++ b/packages/core/src/percy.js @@ -155,10 +155,7 @@ export class Percy { return Array.isArray(next) && [path, next]; }); const concurrency = this.config.discovery.concurrency; - var snapshotConcurrency = concurrency; - if (this.config.discovery.snapshotConcurrency) { - snapshotConcurrency = this.config.discovery.snapshotConcurrency; - } + const snapshotConcurrency = parseInt(process.env.PERCY_SNAPSHOT_UPLOAD_CONCURRENCY) || concurrency; this.#discovery.set({ concurrency }); this.#snapshots.set({ snapshotConcurrency });