diff --git a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts index 5e2d426dc2b..0c4d09c8e8d 100644 --- a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts +++ b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts @@ -1,6 +1,7 @@ import { all, call, + delay, put, select, take, @@ -440,7 +441,11 @@ function* evaluateActionParams( const arrDatatype: Array = []; // array of objects containing blob urls that is loops and individual object is checked for resolution of blob urls. - for (const val of value) { + + const BATCH_CHUNK_SIZE = 100; + + for (let j = 0; j < value.length; j++) { + const val = value[j]; // TODO: Fix this the next time the file is edited // eslint-disable-next-line @typescript-eslint/no-explicit-any const newVal: Record = yield call( @@ -473,6 +478,11 @@ function* evaluateActionParams( filePickerInstrumentation["fileSizes"].push(size); filePickerInstrumentation["fileTypes"].push(type); } + + if ((j + 1) % BATCH_CHUNK_SIZE === 0) { + // Yield control back to the event loop and empty the stack trace + yield delay(0); + } } //Adding array datatype along with the datatype of first element of the array