debug on exec

This commit is contained in:
mr 2024-09-23 09:45:05 +02:00
parent 754925c32c
commit a0dd8e1c42

View File

@ -244,14 +244,14 @@ func (wfa *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (util
// avoid the update if the schedule is the same // avoid the update if the schedule is the same
avoid := set.(*Workflow).Schedule == nil || (res.(*Workflow).Schedule != nil && res.(*Workflow).ScheduleActive == set.(*Workflow).ScheduleActive && res.(*Workflow).Schedule.Start == set.(*Workflow).Schedule.Start && res.(*Workflow).Schedule.End == set.(*Workflow).Schedule.End && res.(*Workflow).Schedule.Cron == set.(*Workflow).Schedule.Cron) avoid := set.(*Workflow).Schedule == nil || (res.(*Workflow).Schedule != nil && res.(*Workflow).ScheduleActive == set.(*Workflow).ScheduleActive && res.(*Workflow).Schedule.Start == set.(*Workflow).Schedule.Start && res.(*Workflow).Schedule.End == set.(*Workflow).Schedule.End && res.(*Workflow).Schedule.Cron == set.(*Workflow).Schedule.Cron)
res, code, err = wfa.GenericUpdateOne(set, id, wfa, &Workflow{}) res, code, err = wfa.GenericUpdateOne(set, id, wfa, &Workflow{})
fmt.Println(code, err) fmt.Println("UPDATE", code, err)
if code != 200 { if code != 200 {
return nil, code, err return nil, code, err
} }
if !avoid { // if the schedule is not avoided, update the executions if !avoid { // if the schedule is not avoided, update the executions
if code, err := wfa.execution(id, res.(*Workflow), true); code != 200 { if code, err := wfa.execution(id, res.(*Workflow), true); code != 200 {
fmt.Println(code, err) fmt.Println("TEST", code, err)
return nil, code, err return nil, code, errors.New("could not update the executions : " + err.Error())
} }
} }
wfa.execute(res.(*Workflow), false) // update the workspace for the workflow wfa.execute(res.(*Workflow), false) // update the workspace for the workflow