add max iterations env variable
This commit is contained in:
parent
47480450d8
commit
2d75e68717
|
@ -62,6 +62,7 @@ module.exports = {
|
||||||
SENDGRID_API_KEY: process.env.SENDGRID_API_KEY,
|
SENDGRID_API_KEY: process.env.SENDGRID_API_KEY,
|
||||||
DYNAMO_ENDPOINT: process.env.DYNAMO_ENDPOINT,
|
DYNAMO_ENDPOINT: process.env.DYNAMO_ENDPOINT,
|
||||||
POSTHOG_TOKEN: process.env.POSTHOG_TOKEN,
|
POSTHOG_TOKEN: process.env.POSTHOG_TOKEN,
|
||||||
|
AUTOMATION_MAX_ITERATIONS: process.env.AUTOMATION_MAX_ITERATIONS,
|
||||||
// old - to remove
|
// old - to remove
|
||||||
CLIENT_ID: process.env.CLIENT_ID,
|
CLIENT_ID: process.env.CLIENT_ID,
|
||||||
BUDIBASE_DIR: process.env.BUDIBASE_DIR,
|
BUDIBASE_DIR: process.env.BUDIBASE_DIR,
|
||||||
|
|
|
@ -15,6 +15,7 @@ const LOOP_STEP_ID = actions.ACTION_DEFINITIONS.LOOP.stepId
|
||||||
const CRON_STEP_ID = triggerDefs.CRON.stepId
|
const CRON_STEP_ID = triggerDefs.CRON.stepId
|
||||||
const STOPPED_STATUS = { success: false, status: "STOPPED" }
|
const STOPPED_STATUS = { success: false, status: "STOPPED" }
|
||||||
const { cloneDeep } = require("lodash/fp")
|
const { cloneDeep } = require("lodash/fp")
|
||||||
|
const env = require("../environment")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The automation orchestrator is a class responsible for executing automations.
|
* The automation orchestrator is a class responsible for executing automations.
|
||||||
|
@ -170,7 +171,10 @@ class Orchestrator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index >= loopStep.inputs.iterations) {
|
if (
|
||||||
|
index === env.AUTOMATION_MAX_ITERATIONS ||
|
||||||
|
index === loopStep.inputs.iterations
|
||||||
|
) {
|
||||||
this.updateContextAndOutput(loopStepNumber, step, tempOutput, {
|
this.updateContextAndOutput(loopStepNumber, step, tempOutput, {
|
||||||
status: "MAX_ITERATIONS_REACHED",
|
status: "MAX_ITERATIONS_REACHED",
|
||||||
success: true,
|
success: true,
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue