correct is DC link
This commit is contained in:
parent
bfbcd58d1b
commit
d13249d87d
@ -140,7 +140,14 @@ func (wfa *workflowMongoAccessor) book(id string, realData *Workflow, execs []*w
|
||||
|
||||
func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delete bool) (int, error) {
|
||||
if realData.Schedule == nil && realData.ScheduleActive {
|
||||
return 200, nil
|
||||
res, code, err := wfa.LoadOne(id)
|
||||
if code == 200 {
|
||||
r := res.(*Workflow)
|
||||
if r.Schedule != nil {
|
||||
err = wfa.book(id, r, []*workflow_execution.WorkflowExecution{})
|
||||
}
|
||||
}
|
||||
return 200, err
|
||||
}
|
||||
if realData.Schedule == nil && !realData.ScheduleActive {
|
||||
mongo.MONGOService.DeleteMultiple(map[string]interface{}{
|
||||
@ -150,7 +157,10 @@ func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delet
|
||||
err := wfa.book(id, realData, []*workflow_execution.WorkflowExecution{})
|
||||
return 200, err
|
||||
}
|
||||
res, _, _ := wfa.LoadOne(id)
|
||||
res, code, _ := wfa.LoadOne(id)
|
||||
if code != 200 {
|
||||
return 404, errors.New("could not load workflow")
|
||||
}
|
||||
r := res.(*Workflow)
|
||||
if r.Schedule != nil && r.Schedule.Start == realData.Schedule.Start && r.Schedule.End == realData.Schedule.End && r.Schedule.Cron == realData.Schedule.Cron {
|
||||
return 200, nil
|
||||
|
Loading…
Reference in New Issue
Block a user