This commit is contained in:
mr 2024-11-21 08:45:03 +01:00
parent e9b3a65a0e
commit 15ca06aba8

View File

@ -258,7 +258,7 @@ func (wfa *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (util
fmt.Println("UPDATE", workflow.ScheduleActive, workflow.Schedule) fmt.Println("UPDATE", workflow.ScheduleActive, workflow.Schedule)
if workflow.ScheduleActive && workflow.Schedule != nil { // if the workflow is scheduled, update the executions if workflow.ScheduleActive && workflow.Schedule != nil { // if the workflow is scheduled, update the executions
now := time.Now().UTC() now := time.Now().UTC()
if (workflow.Schedule.End != nil && now.After(*workflow.Schedule.End)) || (workflow.Schedule.End == nil && workflow.Schedule.Start != nil && now.After(*d.Schedule.Start)) { // if the start date is passed, then you can book 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 workflow.ScheduleActive = false
wfa.GenericRawUpdateOne(workflow, id, wfa) wfa.GenericRawUpdateOne(workflow, id, wfa)
} // if the start date is passed, update the executions } // if the start date is passed, update the executions