diff --git a/models/workflow/workflow_mongo_accessor.go b/models/workflow/workflow_mongo_accessor.go index 9323710..4484919 100644 --- a/models/workflow/workflow_mongo_accessor.go +++ b/models/workflow/workflow_mongo_accessor.go @@ -218,12 +218,6 @@ func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delet fmt.Println("BOOKING2", err, delete) if delete { // if delete is set to true, delete the executions - mongo.MONGOService.DeleteMultiple(map[string]interface{}{ - "workflow_id": id, - "state": 1, - }, utils.WORKFLOW_EXECUTION.String()) - wfa.book(id, realData, []*workflow_execution.WorkflowExecution{}) - nats.SetNATSPub(utils.WORKFLOW.String(), tools.REMOVE, realData) return 200, nil } fmt.Println("EXECS", err, len(execs)) @@ -256,7 +250,7 @@ func (wfa *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (util 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 { + if code, err := wfa.execution(id, res.(*Workflow), false); code != 200 { fmt.Println("TEST", code, err) return nil, code, errors.New("could not update the executions : " + err.Error()) }