diff --git a/ts/smartrule.classes.smartrule.ts b/ts/smartrule.classes.smartrule.ts index b721a18..4fecfb6 100644 --- a/ts/smartrule.classes.smartrule.ts +++ b/ts/smartrule.classes.smartrule.ts @@ -26,7 +26,7 @@ export class SmartRule { }; // lets run the checks - const runNextBatch = async (startPriority: number) => { + const runNextBatch = async (startPriority: number): Promise => { const nextBatch = getNextParallelBatch(0); const outcomes: TTreeActionResult[] = []; for (const rule of nextBatch) { @@ -51,7 +51,9 @@ export class SmartRule { } if (startPriority < this.rules[this.rules.length-1].priority) { - runNextBatch(startPriority++); + await runNextBatch(startPriority++); + } else { + return; } };