test booking

This commit is contained in:
mr 2024-09-24 09:54:18 +02:00
parent 5c9adcf597
commit 021b461b0a

View File

@ -218,12 +218,6 @@ func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delet
fmt.Println("BOOKING2", err, delete) fmt.Println("BOOKING2", err, delete)
if delete { // if delete is set to true, delete the executions if delete { // if delete is set to true, delete the executions
mongo.MONGOService.DeleteMultiple(map[string]interface{}{
"workflow_id": id,
"state": 1,
}, utils.WORKFLOW_EXECUTION.String())
wfa.book(id, realData, []*workflow_execution.WorkflowExecution{})
nats.SetNATSPub(utils.WORKFLOW.String(), tools.REMOVE, realData)
return 200, nil return 200, nil
} }
fmt.Println("EXECS", err, len(execs)) fmt.Println("EXECS", err, len(execs))
@ -256,7 +250,7 @@ func (wfa *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (util
return nil, code, err return nil, code, err
} }
if !avoid { // if the schedule is not avoided, update the executions if !avoid { // if the schedule is not avoided, update the executions
if code, err := wfa.execution(id, res.(*Workflow), true); code != 200 { if code, err := wfa.execution(id, res.(*Workflow), false); code != 200 {
fmt.Println("TEST", code, err) fmt.Println("TEST", code, err)
return nil, code, errors.New("could not update the executions : " + err.Error()) return nil, code, errors.New("could not update the executions : " + err.Error())
} }