Centralize chunking and retry logic on platform level#655
Centralize chunking and retry logic on platform level#655arugupta1992 wants to merge 1 commit intostagefrom
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 = { |
|
|
||
| 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.
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.
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) { |
| }; | ||
| } | ||
|
|
||
| export const DEFAULT_CHUNK_CONFIG = { |
There was a problem hiding this comment.
this is not being used anywhere.
There was a problem hiding this comment.
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: