set flag in automation orchestrator
This commit is contained in:
parent
6818e4debb
commit
a9bb534cdf
|
@ -187,7 +187,7 @@
|
||||||
{#if !isTrigger}
|
{#if !isTrigger}
|
||||||
<div>
|
<div>
|
||||||
<div class="block-options">
|
<div class="block-options">
|
||||||
{#if block?.features.includes("LOOPING")}
|
{#if block?.features?.includes("LOOPING")}
|
||||||
<ActionButton on:click={() => addLooping()} icon="Reuse">
|
<ActionButton on:click={() => addLooping()} icon="Reuse">
|
||||||
Add Looping
|
Add Looping
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
|
|
|
@ -70,7 +70,7 @@ export const Features = {
|
||||||
ENFORCEABLE_SSO: "enforceableSSO",
|
ENFORCEABLE_SSO: "enforceableSSO",
|
||||||
BRANDING: "branding",
|
BRANDING: "branding",
|
||||||
SCIM: "scim",
|
SCIM: "scim",
|
||||||
SYNC_AUTOMATIONS: "syncAutoamtions",
|
SYNC_AUTOMATIONS: "syncAutomations",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Role IDs
|
// Role IDs
|
||||||
|
|
|
@ -68,6 +68,7 @@ class Orchestrator {
|
||||||
constructor(job: AutomationJob) {
|
constructor(job: AutomationJob) {
|
||||||
let automation = job.data.automation
|
let automation = job.data.automation
|
||||||
let triggerOutput = job.data.event
|
let triggerOutput = job.data.event
|
||||||
|
let timeout = job.data.event.timeout
|
||||||
const metadata = triggerOutput.metadata
|
const metadata = triggerOutput.metadata
|
||||||
this._chainCount = metadata ? metadata.automationChainCount! : 0
|
this._chainCount = metadata ? metadata.automationChainCount! : 0
|
||||||
this._appId = triggerOutput.appId as string
|
this._appId = triggerOutput.appId as string
|
||||||
|
@ -240,7 +241,9 @@ class Orchestrator {
|
||||||
let loopStepNumber: any = undefined
|
let loopStepNumber: any = undefined
|
||||||
let loopSteps: LoopStep[] | undefined = []
|
let loopSteps: LoopStep[] | undefined = []
|
||||||
let metadata
|
let metadata
|
||||||
|
let timeoutFlag = false
|
||||||
let wasLoopStep = false
|
let wasLoopStep = false
|
||||||
|
let timeout = this._job.data.event.timeout
|
||||||
// check if this is a recurring automation,
|
// check if this is a recurring automation,
|
||||||
if (isProdAppID(this._appId) && isRecurring(automation)) {
|
if (isProdAppID(this._appId) && isRecurring(automation)) {
|
||||||
metadata = await this.getMetadata()
|
metadata = await this.getMetadata()
|
||||||
|
@ -251,6 +254,16 @@ class Orchestrator {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let step of automation.definition.steps) {
|
for (let step of automation.definition.steps) {
|
||||||
|
if (timeoutFlag) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if (timeout) {
|
||||||
|
setTimeout(() => {
|
||||||
|
timeoutFlag = true
|
||||||
|
}, timeout || 12000)
|
||||||
|
}
|
||||||
|
|
||||||
stepCount++
|
stepCount++
|
||||||
let input: any,
|
let input: any,
|
||||||
iterations = 1,
|
iterations = 1,
|
||||||
|
@ -391,7 +404,7 @@ class Orchestrator {
|
||||||
emitter: this._emitter,
|
emitter: this._emitter,
|
||||||
context: this._context,
|
context: this._context,
|
||||||
})
|
})
|
||||||
|
console.log("after stepFn")
|
||||||
this._context.steps[stepCount] = outputs
|
this._context.steps[stepCount] = outputs
|
||||||
// if filter causes us to stop execution don't break the loop, set a var
|
// if filter causes us to stop execution don't break the loop, set a var
|
||||||
// so that we can finish iterating through the steps and record that it stopped
|
// so that we can finish iterating through the steps and record that it stopped
|
||||||
|
|
Loading…
Reference in New Issue