diff --git a/models/workflow/workflow_mongo_accessor.go b/models/workflow/workflow_mongo_accessor.go index 8cc7d50..c9b2c2d 100644 --- a/models/workflow/workflow_mongo_accessor.go +++ b/models/workflow/workflow_mongo_accessor.go @@ -253,7 +253,7 @@ func (wfa *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (util now := time.Now().UTC() if (workflow.Schedule.End != nil && now.After(*workflow.Schedule.End)) || (workflow.Schedule.End == nil && workflow.Schedule.Start != nil && now.After(*workflow.Schedule.Start)) { // if the start date is passed, then you can book workflow.ScheduleActive = false - wfa.UpdateOne(workflow, id) + wfa.GenericUpdateOne(workflow, id, wfa, &Workflow{}) } // if the start date is passed, update the executions } if !avoid { // if the schedule is not avoided, update the executions @@ -277,7 +277,7 @@ func (wfa *workflowMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, now := time.Now().UTC() if (workflow.Schedule.End != nil && now.After(*workflow.Schedule.End)) || (workflow.Schedule.End == nil && workflow.Schedule.Start != nil && now.After(*workflow.Schedule.Start)) { // if the start date is passed, then you can book workflow.ScheduleActive = false - wfa.UpdateOne(workflow, workflow.UUID) + wfa.GenericUpdateOne(workflow, workflow.UUID, wfa, &Workflow{}) } // if the start date is passed, update the executions } wfa.share(workflow, false, wfa.Caller) // share the creation to the peers @@ -350,7 +350,7 @@ func (wfa *workflowMongoAccessor) LoadOne(id string) (utils.DBObject, int, error now := time.Now().UTC() if (workflow.Schedule.End != nil && now.After(*workflow.Schedule.End)) || (workflow.Schedule.End == nil && workflow.Schedule.Start != nil && now.After(*workflow.Schedule.Start)) { // if the start date is passed, then you can book workflow.ScheduleActive = false - wfa.UpdateOne(&workflow, id) + wfa.GenericUpdateOne(&workflow, id, wfa, &Workflow{}) } // if the start date is passed, update the executions } wfa.execute(&workflow, false, true) // if no workspace is attached to the workflow, create it