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) {
return nil, err
}
fmt.Println("LaunchPeerExecution", method, url, methods[method], body)
if method == tools.POST {
b, err = caller.CallPost(url, methods[method], body)
}

View File

@ -2,6 +2,7 @@ package oclib
import (
"errors"
"fmt"
"strings"
"cloud.o-forge.io/core/oc-lib/dbs"
@ -111,11 +112,13 @@ func (wfa *workflowMongoAccessor) book(id string, realData *Workflow, execs []*w
}
// CHECK BOOKING
peerID := dc.(*datacenter.DatacenterResource).PeerID
fmt.Println("PEER ID", peerID)
if peerID == "" {
continue
}
paccess := (&peer.Peer{})
p, code, _ := paccess.GetAccessor(nil).LoadOne(peerID)
fmt.Println("PEER", p, code)
if code != 200 {
continue
}
@ -125,6 +128,7 @@ func (wfa *workflowMongoAccessor) book(id string, realData *Workflow, execs []*w
ResourceID: dc_id,
Executions: execs,
}).Serialize(), wfa.Caller)
fmt.Println("LaunchPeerExecution RES", b, err)
if err != nil && b == nil {
return err
}