Compare commits

..

No commits in common. "754925c32c6404ab495587fe409dd24629f61bbb" and "4f0ab6a3760ff092be5cfb235d8d243c74acb13a" have entirely different histories.

View File

@ -2,7 +2,6 @@ package workflow
import (
"errors"
"fmt"
"strings"
"cloud.o-forge.io/core/oc-lib/dbs"
@ -198,10 +197,7 @@ func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delet
}, utils.WORKFLOW_EXECUTION.String())
err := wfa.book(id, realData, []*workflow_execution.WorkflowExecution{}) // delete the booking of the workflow on the peers
nats.SetNATSPub(utils.WORKFLOW.String(), tools.REMOVE, realData) // send the deletion to the nats
if err != nil {
return 409, err
}
return 200, nil
return 200, err
}
accessor := (&workflow_execution.WorkflowExecution{}).GetAccessor(nil)
execs, err := wfa.getExecutions(id, realData) // get the executions of the workflow
@ -244,13 +240,11 @@ func (wfa *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (util
// 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)
res, code, err = wfa.GenericUpdateOne(set, id, wfa, &Workflow{})
fmt.Println(code, err)
if code != 200 {
return nil, code, err
}
if !avoid { // if the schedule is not avoided, update the executions
if code, err := wfa.execution(id, res.(*Workflow), true); code != 200 {
fmt.Println(code, err)
if code, err := wfa.execution(id, res.(*Workflow), true); err != nil {
return nil, code, err
}
}