This commit is contained in:
mr 2024-11-20 16:08:54 +01:00
parent b49685aa82
commit 57f18b2244

View File

@ -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