Team, I have a scheduled script that is running ou...
# suitescript
a
Team, I have a scheduled script that is running out of governance units. What is the best approach to overcome the limitation for a bunch of records? In this case, I cannot use a Map/Reduce script because the data is dependent of each other. Any ideas? I see for SuiteScript 1.0 there was “`nlapiSetRecoveryPoint` and
nlapiYieldScript"
. Is there something similar in SuiteScript 2.0? Or a different approach? Thanks!
b
using task.ScheduledScriptTask to start the script over again is the usual
usually involves dividing your data into independent parts and scheduling a new task between parts
l
I’d say first review why the script is running out of governance units? Is there a function that manipulates data per line item? Can that be customized further? Should you split the entire script into 2 map/reduce scripts? Should you create multiple deployments and break down the process? Reason why there’s no API for yielding in M/R is that yield already happens automatically during map or reduce stage. Thus, when dealing with governance usage, M/R is already a solution itself.
a
Thank you guys for the responses
as I said, the task is not easily breakable in different parts
otherwise I would use a Map/Reduce
b
you have already received the generic use less points or divide your task into parts
share the code if you want more specific advice
a
thanks, I am monitoring the governance and rescheduling the job