reduceContext.isRestarted
Property Description |
Indicates whether the reduce(reduceContext) function has run before for the current key and values. For an overview of events that can cause a restart, see System Response After a Map/Reduce Interruption. When the reduce function restarts for a key-value pair, any data it wrote last time is deleted. Some logic might have run before it was interrupted, so if reduceContext.isRestarted is true, your script should take steps to avoid duplicate processing. For examples, see Adding Logic to Handle Map/Reduce Restarts. For examples, see Adding Logic to Handle Map/Reduce Restarts. Related properties include reduceContext.executionNo and reduceContext.errors. |
Type |
boolean |
Since |
2016.1 |
Syntax
The following code snippet shows the syntax for this member. It's not a functional example. For a complete script example, see SuiteScript 2.x Map/Reduce Script Code Samples.
// Add additional code.
...
function reduce (context) {
if (context.isRestarted)
{
// Add logic designed to assess how much processing was completed for this key
// and react accordingly.
}
else
{
// Let full processing continue for the current key and its values.
}
...
// Add additional code.