From 6497e7dbdd51aaf52294de222adbe5e3b9347cb5 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 12 Nov 2024 13:36:18 +0100 Subject: [PATCH] state execution --- models/utils/abstracts.go | 2 +- models/workflow_execution/workflow_execution_mongo_accessor.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/utils/abstracts.go b/models/utils/abstracts.go index 86d4738..ff0ea85 100644 --- a/models/utils/abstracts.go +++ b/models/utils/abstracts.go @@ -163,7 +163,7 @@ func (dma *AbstractAccessor) GenericUpdateOne(set DBObject, id string, accessor // GenericLoadOne loads one object from the database (generic) // json expected in entry is a flatted object no need to respect the inheritance hierarchy -func (dma *AbstractAccessor) GenericRawUpdateOne(set DBObject, id string, accessor Accessor, new DBObject) (DBObject, int, error) { +func (dma *AbstractAccessor) GenericRawUpdateOne(set DBObject, id string, accessor Accessor) (DBObject, int, error) { id, code, err := mongo.MONGOService.UpdateOne(set, id, accessor.GetType()) if err != nil { dma.Logger.Error().Msg("Could not update " + id + " to db. Error: " + err.Error()) diff --git a/models/workflow_execution/workflow_execution_mongo_accessor.go b/models/workflow_execution/workflow_execution_mongo_accessor.go index 9d016b0..7806046 100644 --- a/models/workflow_execution/workflow_execution_mongo_accessor.go +++ b/models/workflow_execution/workflow_execution_mongo_accessor.go @@ -44,7 +44,7 @@ func (wfa *workflowExecutionMongoAccessor) LoadOne(id string) (utils.DBObject, i fmt.Println("workflow: ", workflow.State, time.Now().UTC().After(*workflow.ExecDate)) if workflow.State == SCHEDULED && time.Now().UTC().After(*workflow.ExecDate) { workflow.State = FORGOTTEN - wfa.UpdateOne(&workflow, id) + wfa.GenericRawUpdateOne(&workflow, id, wfa) } return &workflow, 200, nil }