Hi, I have a map/reduce script that should process...
# suitescript
m
Hi, I have a map/reduce script that should process like 30K records, arrange them per customer, and create a journal for each. It keeps hitting the 60min limit. I am trying to go around it this way
Copy code
if (err.name == "SSS_USAGE_LIMIT_EXCEEDED") {
  logger.log("Total journals processed: " + totalJournalsProcessed);
  logger.log("Total number of usage units consumed: " + summary.usage);
  logger.log("Execution Usage Limit Exceeded!");

  task
    .create({
      taskType: task.TaskType.MAP_REDUCE,
      scriptId: "customscript_mr_aggregate_ship_jr",
      deploymentId: "customdeploy_mr_aggregate_ship_jr",
    })
    .submit();

  logger.log("Resubmitted the script!");
  return;
}
but it keeps throwing this error
com.netsuite.suitescript.scriptobject.ScriptNullObjectAdapter@ba3bbcc
and doesn't restart the script. Any ideas on what could be done to keep it going?
g
There isnt really a fix if you if you have reached your useage limit. Clean code though! if that doesnt work... im stumped. resubmitting a Map/Reduce script, and then logging a message indicating that the script has been resubmitted is cleaver though!
m
Will see how it goes. Thanks.