state execution

This commit is contained in:
mr 2024-11-12 13:36:18 +01:00
parent b5dba2458a
commit 6497e7dbdd
2 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ func (dma *AbstractAccessor) GenericUpdateOne(set DBObject, id string, accessor
// GenericLoadOne loads one object from the database (generic) // GenericLoadOne loads one object from the database (generic)
// json expected in entry is a flatted object no need to respect the inheritance hierarchy // 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()) id, code, err := mongo.MONGOService.UpdateOne(set, id, accessor.GetType())
if err != nil { if err != nil {
dma.Logger.Error().Msg("Could not update " + id + " to db. Error: " + err.Error()) dma.Logger.Error().Msg("Could not update " + id + " to db. Error: " + err.Error())

View File

@ -44,7 +44,7 @@ func (wfa *workflowExecutionMongoAccessor) LoadOne(id string) (utils.DBObject, i
fmt.Println("workflow: ", workflow.State, time.Now().UTC().After(*workflow.ExecDate)) fmt.Println("workflow: ", workflow.State, time.Now().UTC().After(*workflow.ExecDate))
if workflow.State == SCHEDULED && time.Now().UTC().After(*workflow.ExecDate) { if workflow.State == SCHEDULED && time.Now().UTC().After(*workflow.ExecDate) {
workflow.State = FORGOTTEN workflow.State = FORGOTTEN
wfa.UpdateOne(&workflow, id) wfa.GenericRawUpdateOne(&workflow, id, wfa)
} }
return &workflow, 200, nil return &workflow, 200, nil
} }