Hi,
I am trying to save the data into state storage.
I have one lakh JSON data to be saved.
My code is splitting the data into 1000 and saving into state.
state.storage.put(objDataToStore)
objDataToStore will contains 1000 keys and values.
The loop will run for 1 lakh data with 1000 data in each call.
I am getting the time out error.
“Durable Object storage operation exceeded timeout which caused object to be reset”
With 8000 data, this works fine. (1000 key value in each call for 8 times in a loop)
Please help me with solution.
Below is the code used.
let objDataToStore = {};
arrData.map((objData, intIndex)=>{
objDataToStore = {…objDataToStore, [objData[this.strPrimaryKeyName]] : objData};
if((intIndex+1)%500 == 0 || (intIndex+1) == arrData.length){
this.state.storage.put(objDataToStore);
objDataToStore = {};
}
})