NETSUITE开发者实战培训

后台脚本无限环问题

2019-09-18  本文已影响0人  e85a69573d55

用例:用户有一个“定时任务”脚本处于“Processing”的死循环状态或者因为逻辑错误导致脚本在运行中不能停止。

回答:用户不可以主动停止一个正在运行中的脚本任务。如果一个脚本没有主动调用`nlapiYieldScript`,这个进入死循环状态的脚本在没有其他任何配合超出的错误爆出时,会在大概一小时后自动停止。并且脚本的执行状态标记为`Failed`。并且该状态会显示在脚本部署的页面下的`执行日志`的分项卡下边。

Use Case: Customer has a scheduled script with an infinite loop in 'Processing' status or a wrong logic that causes the script to run endlessly.

Answer: User cannot stop a currently processing script. If the scheduled script does not include an nlapiYieldScript API call, the scheduled script with the infinite loop execution time can be up to one (1) hour before it's terminated by other monitoring system processes. The status of the script is set to 'Failed' and this is logged in the Execution Log subtab on the script deployment record.

The script will be terminated and an SSS_INSTRUCTION_COUNT_EXCEEDED error message is thrown.

Should the user receive this error, NetSuite recommends that user examines the for loops in the script to ensure that they contain either a terminating condition or a condition that can be met.

There are possible instances where the infinite loop may also lead to exceeding SuiteScript Governance Limit when API calls are made within the loop. A SSS_USAGE_LIMIT_EXCEEDED error will be thrown in this scenario.

In cases where governance on script logging is exceeded, NetSuite will change the offending script's log level to the next level higher. The offending script will continue its execution, however, its log level will go from Debug to Audit, or Audit to Error, or Error to Emergency, depending on the script.

上一篇下一篇

猜你喜欢

热点阅读