feat: Implement auto-run interval for triggers of completed flows

This commit is contained in:
Faruk AYDIN
2022-03-23 17:32:13 +03:00
committed by Ömer Faruk Aydın
parent 3715291df7
commit 22e1fe5c44
13 changed files with 134 additions and 37 deletions

View File

@@ -7,6 +7,11 @@ import ExecutionStep from '../models/execution-step';
type ExecutionSteps = Record<string, ExecutionStep>;
type ProcessorOptions = {
untilStep?: Step;
testRun?: boolean;
};
class Processor {
flow: Flow;
untilStep: Step;
@@ -14,10 +19,10 @@ class Processor {
static variableRegExp = /({{step\..+\..+}})/g;
constructor(flow: Flow, untilStep: Step, { testRun = false }) {
constructor(flow: Flow, processorOptions: ProcessorOptions) {
this.flow = flow;
this.untilStep = untilStep;
this.testRun = testRun;
this.untilStep = processorOptions.untilStep;
this.testRun = processorOptions.testRun;
}
async run() {
@@ -89,7 +94,7 @@ class Processor {
priorExecutionSteps[id] = previousExecutionStep;
if (id === this.untilStep.id) {
if (id === this.untilStep?.id) {
break;
}
}