This topic contains 4 replies, has 0 voices, and was last updated by chanarbon 7 years, 8 months ago.

  • Author
    Posts
  • #1216

    tbousfield

    Is there a way to reset the usage limit in SS 2.0?
    This is a cached copy. Click here to see the original post.

  • #1217

    david.smith

    What are you trying to do? The short answer is no. But there is always room for code review/improvements or performing the process another way.


    erictgrubaugh replied on 02/02/2017, 10:22 AM: Yes! If you share your code we can help analyze and optimize it to minimize the governance usage. The governance limit is there so you don’t have runaway code on a shared server instance. The approach should be to fix the script design rather than circumvent the limit.

  • #1218

    chanarbon

    If you want to do it in scheduled script in 2.0, no. You can use Map/Reduce and build the code keeping in mind that the code runs with parallel context. I also agree with Eric from the statement above that it is rather a matter of better logic or placing of the functions e.g. why not use submitFields() instead of load and save()

  • #1219

    ialan

    Here is the code for rescheduling script in Suitescript 2.0

    [CODE]

    function reschedule(rescheduleParams) {

    var scriptTask = task.create({

    taskType : task.TaskType.SCHEDULED_SCRIPT

    });

    scriptTask.scriptId = ‘customscript_xxx’;

    scriptTask.deploymentId = ‘customdeploy_yyy’;

    scriptTask.params = rescheduleParams;

    var scriptTaskId = scriptTask.submit();

    log.debug(‘Success:’ + scriptTaskId);

    }

    [CODE]

  • #1220

    chanarbon

    Originally posted by ialan

    View Post

    Here is the code for rescheduling script in Suitescript 2.0

    [CODE]

    function reschedule(rescheduleParams) {

    var scriptTask = task.create({

    taskType : task.TaskType.SCHEDULED_SCRIPT

    });

    scriptTask.scriptId = ‘customscript_xxx’;

    scriptTask.deploymentId = ‘customdeploy_yyy’;

    scriptTask.params = rescheduleParams;

    var scriptTaskId = scriptTask.submit();

    log.debug(‘Success:’ + scriptTaskId);

    }

    [CODE]

    Yup. You can perform scheduling API but it does not totally reset the usage units with the current working context that’s why better use M/R as it would automatically perform the yielding for you.

You must be logged in to reply to this topic.