id on peer

This commit is contained in:
mr 2024-08-20 13:31:11 +02:00
parent fbf4040f63
commit f599131708
2 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,7 @@ func (p *PeerCache) LaunchPeerExecution(peerID string, dataID string, url string
if !p.checkPeerStatus(peerID) { if !p.checkPeerStatus(peerID) {
return nil, err return nil, err
} }
fmt.Println("LaunchPeerExecution", method, url, methods[method], body)
if method == tools.POST { if method == tools.POST {
b, err = caller.CallPost(url, methods[method], body) b, err = caller.CallPost(url, methods[method], body)
} }

View File

@ -2,6 +2,7 @@ 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"
@ -111,11 +112,13 @@ func (wfa *workflowMongoAccessor) book(id string, realData *Workflow, execs []*w
} }
// CHECK BOOKING // CHECK BOOKING
peerID := dc.(*datacenter.DatacenterResource).PeerID peerID := dc.(*datacenter.DatacenterResource).PeerID
fmt.Println("PEER ID", peerID)
if peerID == "" { if peerID == "" {
continue continue
} }
paccess := (&peer.Peer{}) paccess := (&peer.Peer{})
p, code, _ := paccess.GetAccessor(nil).LoadOne(peerID) p, code, _ := paccess.GetAccessor(nil).LoadOne(peerID)
fmt.Println("PEER", p, code)
if code != 200 { if code != 200 {
continue continue
} }
@ -125,6 +128,7 @@ func (wfa *workflowMongoAccessor) book(id string, realData *Workflow, execs []*w
ResourceID: dc_id, ResourceID: dc_id,
Executions: execs, Executions: execs,
}).Serialize(), wfa.Caller) }).Serialize(), wfa.Caller)
fmt.Println("LaunchPeerExecution RES", b, err)
if err != nil && b == nil { if err != nil && b == nil {
return err return err
} }