1
0
Fork 0
mirror of synced 2024-06-28 11:00:55 +12:00

add max iterations env variable

This commit is contained in:
Peter Clement 2022-04-12 09:13:01 +01:00
parent 261b6ccb03
commit a06fcd571b
3 changed files with 899 additions and 14 deletions

View file

@ -62,6 +62,7 @@ module.exports = {
SENDGRID_API_KEY: process.env.SENDGRID_API_KEY,
DYNAMO_ENDPOINT: process.env.DYNAMO_ENDPOINT,
POSTHOG_TOKEN: process.env.POSTHOG_TOKEN,
AUTOMATION_MAX_ITERATIONS: process.env.AUTOMATION_MAX_ITERATIONS,
// old - to remove
CLIENT_ID: process.env.CLIENT_ID,
BUDIBASE_DIR: process.env.BUDIBASE_DIR,

View file

@ -15,6 +15,7 @@ const LOOP_STEP_ID = actions.ACTION_DEFINITIONS.LOOP.stepId
const CRON_STEP_ID = triggerDefs.CRON.stepId
const STOPPED_STATUS = { success: false, status: "STOPPED" }
const { cloneDeep } = require("lodash/fp")
const env = require("../environment")
/**
* 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, {
status: "MAX_ITERATIONS_REACHED",
success: true,

File diff suppressed because it is too large Load diff