Bug on Format date
This commit is contained in:
parent
11c55d422f
commit
fb80e05d6a
@ -45,14 +45,20 @@ func (p *PeerCache) checkPeerStatus(peerID string, caller *tools.HTTPCaller) boo
|
|||||||
url = strings.ReplaceAll(url, "127.0.0.1", utils.PEER.API())
|
url = strings.ReplaceAll(url, "127.0.0.1", utils.PEER.API())
|
||||||
}
|
}
|
||||||
methods := caller.URLS[utils.PEER.String()]
|
methods := caller.URLS[utils.PEER.String()]
|
||||||
|
fmt.Println("checkPeerStatus AFT 3", url, methods)
|
||||||
|
|
||||||
if methods == nil {
|
if methods == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
meth := methods[tools.POST]
|
meth := methods[tools.POST]
|
||||||
|
fmt.Println("checkPeerStatus AFT 4", meth)
|
||||||
|
|
||||||
if meth == "" {
|
if meth == "" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
state := api.CheckRemotePeer(url + meth)
|
state := api.CheckRemotePeer(url + meth)
|
||||||
|
fmt.Println("checkPeerStatus AFT 4", state)
|
||||||
|
|
||||||
return state != tools.DEAD
|
return state != tools.DEAD
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,6 +79,7 @@ func (p *PeerCache) LaunchPeerExecution(peerID string, isMySelf bool, dataID str
|
|||||||
var err error
|
var err error
|
||||||
b := []byte{}
|
b := []byte{}
|
||||||
methods := caller.URLS[dt.String()]
|
methods := caller.URLS[dt.String()]
|
||||||
|
fmt.Println("LaunchPeerExecution AFT 2", methods)
|
||||||
if _, ok := methods[method]; !ok {
|
if _, ok := methods[method]; !ok {
|
||||||
return nil, errors.New("no path found")
|
return nil, errors.New("no path found")
|
||||||
}
|
}
|
||||||
@ -108,7 +115,9 @@ func (p *PeerCache) LaunchPeerExecution(peerID string, isMySelf bool, dataID str
|
|||||||
}
|
}
|
||||||
return pexec, err
|
return pexec, err
|
||||||
}
|
}
|
||||||
if _, ok := m["error"]; !ok {
|
fmt.Println("LaunchPeerExecution AFT 3", m)
|
||||||
|
|
||||||
|
if e, ok := m["error"]; !ok && e != "" {
|
||||||
return nil, errors.New(fmt.Sprintf("%v", m["error"]))
|
return nil, errors.New(fmt.Sprintf("%v", m["error"]))
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -64,6 +64,7 @@ func (wfa *Workflow) CheckBooking(subPath string, caller *tools.HTTPCaller) (boo
|
|||||||
if code != 200 {
|
if code != 200 {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
subPath = strings.ReplaceAll(subPath, ":datacenter_id", fmt.Sprintf("%v", dc_id))
|
||||||
subPath = strings.ReplaceAll(subPath, ":start_date", wfa.getFormat(wfa.Schedule.Start))
|
subPath = strings.ReplaceAll(subPath, ":start_date", wfa.getFormat(wfa.Schedule.Start))
|
||||||
subPath = strings.ReplaceAll(subPath, ":end_date", wfa.getFormat(&e))
|
subPath = strings.ReplaceAll(subPath, ":end_date", wfa.getFormat(&e))
|
||||||
_, err = p.(*peer.Peer).LaunchPeerExecution(peerID, "", p.(*peer.Peer).Url+subPath, utils.BOOKING, tools.GET, nil, caller)
|
_, err = p.(*peer.Peer).LaunchPeerExecution(peerID, "", p.(*peer.Peer).Url+subPath, utils.BOOKING, tools.GET, nil, caller)
|
||||||
|
Loading…
Reference in New Issue
Block a user