-
Notifications
You must be signed in to change notification settings - Fork 11
Centralize chunking and retry logic on platform level #655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stage
Are you sure you want to change the base?
Conversation
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
Commits
|
| async batchUpload(tasks, batchSize) { | ||
| await this.executeInBatches(tasks, batchSize, async (task) => { await task(); }); | ||
| async uploadChunkToStorage(urlString, chunk, fileType, assetId, signal, chunkNumber, chunkContext) { | ||
| const putOpts = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use getApiCallOptions
|
|
||
| try { | ||
| const result = await uploadFunction(urlString, chunk, fileType, assetData.assetId, signal, chunkNumber); | ||
| const result = await uploadFunction(urlString, chunk, fileType, assetId, signal, chunkNumber, chunkContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chunk, fileType, assetId, chunkNumber are already inside chunkContext, no need to send them separately.
| } | ||
|
|
||
| async processUploadedAssets(uploadedAssets) { | ||
| const { executeInBatches } = await import(`${getUnityLibs()}/utils/chunkingUtils.js`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can have something like this:
async _getChunkingUtils() {
if (!this._chunkingUtilsPromise) {
this._chunkingUtilsPromise = import(${getUnityLibs()}/utils/chunkingUtils.js);
}
return this._chunkingUtilsPromise;
}
// usage
const { executeInBatches } = await this._getChunkingUtils();
| return Math.min(baseProgress + chunkProgress, 100); | ||
| } | ||
|
|
||
| export function createChunkUploadErrorMessage(assetId, fileSize, fileType, failedChunkCount) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this method needed?
| }; | ||
| } | ||
|
|
||
| export const DEFAULT_CHUNK_CONFIG = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not being used anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, we can probably remove this.
Testing Notes:
This includes restructuring of code that impacts chunking of files in acrobat. Validate the acrobat workflow with large files, validate the analytics with the current prod.
Also perform sanity for other products upload workflow
Resolves: MWPW-181921
Test URLs: