Skip to content

Commit

Permalink
Fixing few cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit3200 committed Dec 5, 2024
1 parent 52056ef commit 6f1f809
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion packages/client/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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.
Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
});

Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/percy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

Expand Down

0 comments on commit 6f1f809

Please sign in to comment.