SMNCP
12/03/2019, 1:19 PMbattk
12/03/2019, 1:37 PMbattk
12/03/2019, 1:38 PMSMNCP
12/03/2019, 1:41 PMbattk
12/03/2019, 1:44 PMbattk
12/03/2019, 1:44 PMbattk
12/03/2019, 1:44 PMbattk
12/03/2019, 1:44 PMThe maximum duration, in seconds, that a value retrieved by the loader can remain in the cache. Note that the value may be removed from the cache before the ttl limit is reached.
The minimum value is 300 (five minutes) and there is no maximum. The default ttl value is no limit.
Important
A cached value is not guaranteed to stay in the cache for the full duration of the ttl value. The ttl value represents the maximum time that the cached value may be stored.battk
12/03/2019, 1:45 PMaaz
12/03/2019, 2:03 PMconst not very sure as haven't used in map reducescottvonduhn
12/03/2019, 2:35 PMEric B
12/03/2019, 2:50 PMbattk
12/03/2019, 2:52 PMEric B
12/03/2019, 3:05 PMjkabot
12/03/2019, 3:17 PMjkabot
12/03/2019, 3:18 PM/**
* Get the task id of the currently running map/reduce deployment instance.
* i.e. what would be returned from N/task.create().sumbit()
*
* Rely on the fact that a script deployment can only have one running instance at a time.
*/
function getCurrentTaskId() {
const deploymentId = runtime.getCurrentScript().deploymentId;
const results = search.create({
type: search.Type.SCHEDULED_SCRIPT_INSTANCE,
filters: [
['scriptdeployment.scriptid', 'is', deploymentId],
'and',
['status', 'anyof', 'PROCESSING']
],
columns: ['taskid']
}).run().getRange({ start: 0, end: 1 });
if (results.length === 0) {
// should be impossible
throw new Error('Failed to find the currently running script deployment instance.');
}
return results[0].getValue('taskid');
}