Skip to content

Commit 3c1e504

Browse files
committed
Optimized the trigger loading to check better if something is started or not
1 parent 2f02beb commit 3c1e504

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

db-connector.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3271,7 +3271,11 @@ func GetWorkflow(ctx context.Context, id string) (*Workflow, error) {
32713271
workflow = &workflows[0]
32723272
}
32733273
} else if strings.Contains(err.Error(), `cannot load field`) {
3274-
log.Printf("[ERROR] Error in workflow loading. Migrating workflow to new workflow handler (1): %s", err)
3274+
// Due to form migration
3275+
if !strings.Contains(err.Error(), `input_markdown`) {
3276+
log.Printf("[ERROR] Error in workflow loading. Migrating workflow to new workflow handler (1): %s", err)
3277+
}
3278+
32753279
err = nil
32763280
} else {
32773281
return &Workflow{}, err

shared.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4804,9 +4804,11 @@ func HandleGetTriggers(resp http.ResponseWriter, request *http.Request) {
48044804
for _, workflow := range workflows {
48054805
for _, trigger := range workflow.Triggers {
48064806

4807+
/*
48074808
if trigger.Status == "uninitialized" {
48084809
continue
48094810
}
4811+
*/
48104812

48114813
switch trigger.TriggerType {
48124814
case "WEBHOOK":
@@ -4862,7 +4864,7 @@ func HandleGetTriggers(resp http.ResponseWriter, request *http.Request) {
48624864
allHooks = append(allHooks, hook)
48634865
} else {
48644866
hookValue := storedHook
4865-
hookValue.Status = "running"
4867+
//hookValue.Status = "running"
48664868
for _, param := range trigger.Parameters {
48674869
if param.Name == "url" {
48684870
hookValue.Info.Url = param.Value
@@ -4913,7 +4915,7 @@ func HandleGetTriggers(resp http.ResponseWriter, request *http.Request) {
49134915
} else {
49144916
scheduleValue := storedschedule
49154917
scheduleValue.Name = trigger.Label
4916-
scheduleValue.Status = "running"
4918+
//scheduleValue.Status = "running"
49174919

49184920
allSchedules = append(allSchedules, scheduleValue)
49194921
}

0 commit comments

Comments
 (0)