Skip to content

Commit 4473386

Browse files
committed
A lot more optimizations for multi tenant workflows
1 parent 497a4ee commit 4473386

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

shared.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6520,7 +6520,7 @@ func diffWorkflows(oldWorkflow Workflow, parentWorkflow Workflow, update bool) {
65206520
// Check if there is a difference in triggers, and what they are
65216521
// Check if there is a difference in branches, and what they are
65226522

6523-
log.Printf("[DEBUG] Old Child workflow. Actions: %d, Triggers: %d, Branches: %d", len(oldWorkflow.Actions), len(oldWorkflow.Triggers), len(oldWorkflow.Branches))
6523+
log.Printf("[DEBUG] PRE Child workflow %s. Actions: %d, Triggers: %d, Branches: %d", oldWorkflow.ID, len(oldWorkflow.Actions), len(oldWorkflow.Triggers), len(oldWorkflow.Branches))
65246524

65256525
// We create a new ID for each trigger.
65266526
// Older ID is stored in trigger.ReplacementForTrigger
@@ -6656,7 +6656,7 @@ func diffWorkflows(oldWorkflow Workflow, parentWorkflow Workflow, update bool) {
66566656

66576657
changeType, changed := hasActionChanged(newAction, oldAction)
66586658
if changed || len(changeType) > 0 {
6659-
log.Printf("[DEBUG] Action %s (%s) has changed in '%s'", newAction.Label, newAction.ID, changeType)
6659+
//log.Printf("[DEBUG] Action %s (%s) has changed in '%s'", newAction.Label, newAction.ID, changeType)
66606660
updatedActions = append(updatedActions, newAction)
66616661
}
66626662
}
@@ -6764,7 +6764,8 @@ func diffWorkflows(oldWorkflow Workflow, parentWorkflow Workflow, update bool) {
67646764

67656765
changeType, changed := hasTriggerChanged(newAction, oldAction)
67666766
if changed {
6767-
log.Printf("[DEBUG] Trigger %s (%s) has changed in '%s'", newAction.Label, newAction.ID, changeType)
6767+
_ = changeType
6768+
//log.Printf("[DEBUG] Trigger %s (%s) has changed in '%s'", newAction.Label, newAction.ID, changeType)
67686769
// updatedTriggers always has parent workflow's new trigger.
67696770
updatedTriggers = append(updatedTriggers, newAction)
67706771
}
@@ -6836,7 +6837,8 @@ func diffWorkflows(oldWorkflow Workflow, parentWorkflow Workflow, update bool) {
68366837

68376838
changeType, changed := hasBranchChanged(newBranch, oldBranch)
68386839
if changed {
6839-
log.Printf("[DEBUG] Trigger %s (%s) has changed in '%s'", newBranch.Label, newBranch.ID, changeType)
6840+
_ = changeType
6841+
//log.Printf("[DEBUG] Trigger %s (%s) has changed in '%s'", newBranch.Label, newBranch.ID, changeType)
68406842
updatedBranches = append(updatedBranches, newBranch)
68416843
}
68426844
}
@@ -7735,7 +7737,7 @@ func diffWorkflows(oldWorkflow Workflow, parentWorkflow Workflow, update bool) {
77357737
log.Printf("[ERROR] Failed getting static workflow health for %s: %s", childWorkflow.ID, err)
77367738
}
77377739

7738-
log.Printf("[DEBUG] CHILD workflow %s of %s. Actions: %d, Triggers: %d, Branches: %d, Variables: %d, Execution Vars: %d", childWorkflow.ID, parentWorkflow.ID, len(childWorkflow.Actions), len(childWorkflow.Triggers), len(childWorkflow.Branches), len(childWorkflow.WorkflowVariables), len(childWorkflow.ExecutionVariables))
7740+
//log.Printf("[DEBUG] CHILD workflow %s of %s. Actions: %d, Triggers: %d, Branches: %d, Variables: %d, Execution Vars: %d", childWorkflow.ID, parentWorkflow.ID, len(childWorkflow.Actions), len(childWorkflow.Triggers), len(childWorkflow.Branches), len(childWorkflow.WorkflowVariables), len(childWorkflow.ExecutionVariables))
77397741

77407742
err = SetWorkflow(ctx, childWorkflow, childWorkflow.ID)
77417743
if err != nil {

0 commit comments

Comments
 (0)