simplify call to peer

This commit is contained in:
mr 2024-08-26 09:42:07 +02:00
parent 8e80fa88be
commit 144e7f8506

View File

@ -2,7 +2,6 @@ package oclib
import ( import (
"errors" "errors"
"fmt"
"strings" "strings"
"cloud.o-forge.io/core/oc-lib/dbs" "cloud.o-forge.io/core/oc-lib/dbs"
@ -115,13 +114,12 @@ func (wfa *workflowMongoAccessor) book(id string, realData *Workflow, execs []*w
if peerID == "" { if peerID == "" {
continue continue
} }
b, err := (&peer.Peer{}).LaunchPeerExecution(peerID, "", utils.BOOKING, tools.POST, _, err := (&peer.Peer{}).LaunchPeerExecution(peerID, "", utils.BOOKING, tools.POST,
(&workflow_execution.WorkflowExecutions{ (&workflow_execution.WorkflowExecutions{
WorkflowID: id, WorkflowID: id,
ResourceID: dc_id, ResourceID: dc_id,
Executions: execs, Executions: execs,
}).Serialize(), wfa.Caller) }).Serialize(), wfa.Caller)
fmt.Println("LaunchPeerExecutio RES", b, err)
if err != nil { if err != nil {
return err return err
} }
@ -134,7 +132,7 @@ func (wfa *workflowMongoAccessor) book(id string, realData *Workflow, execs []*w
func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delete bool) (int, error) { func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delete bool) (int, error) {
var err error var err error
nats := tools.NewNATSCaller() nats := tools.NewNATSCaller()
if realData.Schedule != nil && !realData.ScheduleActive { if !realData.ScheduleActive {
mongo.MONGOService.DeleteMultiple(map[string]interface{}{ mongo.MONGOService.DeleteMultiple(map[string]interface{}{
"state": 1, "state": 1,
"workflow_id": id, "workflow_id": id,