Discovery Nats automate
This commit is contained in:
parent
767f10323d
commit
65f3318f73
@ -180,11 +180,15 @@ func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delet
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (wfa *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) {
|
func (wfa *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) {
|
||||||
res, code, err := wfa.GenericUpdateOne(set, id, wfa, &Workflow{})
|
res, code, err := wfa.LoadOne(id)
|
||||||
|
if code != 200 {
|
||||||
|
return nil, 409, err
|
||||||
|
}
|
||||||
|
avoid := set.(*Workflow).Schedule == nil || (res.(*Workflow).Schedule != nil && 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{})
|
||||||
if code != 200 {
|
if code != 200 {
|
||||||
return nil, code, err
|
return nil, code, err
|
||||||
}
|
}
|
||||||
avoid := set.(*Workflow).Schedule == nil || (res.(*Workflow).Schedule != nil && res.(*Workflow).Schedule.Start == set.(*Workflow).Schedule.Start && res.(*Workflow).Schedule.End == set.(*Workflow).Schedule.End && res.(*Workflow).Schedule.Cron == set.(*Workflow).Schedule.Cron)
|
|
||||||
if !avoid {
|
if !avoid {
|
||||||
if code, err := wfa.execution(id, res.(*Workflow), true); err != nil {
|
if code, err := wfa.execution(id, res.(*Workflow), true); err != nil {
|
||||||
return nil, code, err
|
return nil, code, err
|
||||||
|
Loading…
Reference in New Issue
Block a user