Fixed a broken part of the condition system which didn't look for skipped/failed nodes
This commit is contained in:
@@ -2466,6 +2466,23 @@ class AppBase:
|
||||
continue
|
||||
|
||||
matching_branches += 1
|
||||
|
||||
# Find if previous is skipped or failed. Skipped != correct branch
|
||||
try:
|
||||
should_skip = False
|
||||
for res in fullexecution["results"]:
|
||||
if res["action"]["id"] == branch["source_id"]:
|
||||
if res["status"] == "FAILURE" or res["status"] == "SKIPPED":
|
||||
should_skip = True
|
||||
|
||||
break
|
||||
|
||||
if should_skip:
|
||||
continue
|
||||
except Exception as e:
|
||||
self.logger.info("[WARNING] Failed handling check of if parent is skipped")
|
||||
|
||||
|
||||
# Remove anything without a condition
|
||||
try:
|
||||
if (branch["conditions"]) == 0 or branch["conditions"] == None:
|
||||
@@ -2475,6 +2492,8 @@ class AppBase:
|
||||
correct_branches += 1
|
||||
continue
|
||||
|
||||
# FIXME: Check if the previous node has a result or not
|
||||
|
||||
self.logger.info("[DEBUG] Relevant conditions: %s" % branch["conditions"])
|
||||
successful_conditions = []
|
||||
failed_conditions = []
|
||||
@@ -2535,6 +2554,8 @@ class AppBase:
|
||||
if matching_branches > 0 and correct_branches > 0:
|
||||
return True, ""
|
||||
|
||||
# FIXME: Check if previous branches are at all finished
|
||||
|
||||
self.logger.info("[DEBUG] Correct branches vs matching branches: %d vs %d" % (correct_branches, matching_branches))
|
||||
return False, {"success": False, "reason": "Minimum of one branch's conditions must be correct to continue. Total: %d of %d" % (correct_branches, matching_branches)}
|
||||
|
||||
|
||||
@@ -4075,7 +4075,7 @@ func runInitEs(ctx context.Context) {
|
||||
|
||||
// FIXME: Have this for all envs in all orgs (loop and find).
|
||||
if len(parsedApikey) > 0 {
|
||||
cleanupSchedule := 600
|
||||
cleanupSchedule := 300
|
||||
environments := []string{"Shuffle"}
|
||||
log.Printf("[DEBUG] Starting schedule setup for execution cleanup every %d seconds. Running first immediately.", cleanupSchedule)
|
||||
cleanupJob := func() func() {
|
||||
|
||||
Reference in New Issue
Block a user