From d8fac883d260a5f23dadd2a58160441de654f40d Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 21 Nov 2024 07:51:59 +0100 Subject: [PATCH] test --- models/workflow/workflow_mongo_accessor.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/workflow/workflow_mongo_accessor.go b/models/workflow/workflow_mongo_accessor.go index 08645a9..9f67d33 100644 --- a/models/workflow/workflow_mongo_accessor.go +++ b/models/workflow/workflow_mongo_accessor.go @@ -348,14 +348,18 @@ func (wfa *workflowMongoAccessor) LoadOne(id string) (utils.DBObject, int, error return nil, code, err } res_mongo.Decode(&workflow) + found := false if workflow.ScheduleActive && workflow.Schedule != nil { // if the workflow is scheduled, update the executions 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.GenericRawUpdateOne(&workflow, id, wfa) + found = true } // if the start date is passed, update the executions } wfa.execute(&workflow, false, true) // if no workspace is attached to the workflow, create it + if found { + wfa.GenericRawUpdateOne(&workflow, id, wfa) + } return &workflow, 200, nil }