Discovery Nats automate

This commit is contained in:
mr 2024-08-22 15:17:14 +02:00
parent 6c28684859
commit fb555be86c

View File

@ -56,8 +56,8 @@ func (p *PeerCache) checkPeerStatus(peerID string, caller *tools.HTTPCaller) boo
url = strings.ReplaceAll(url, "localhost", utils.PEER.API())
url = strings.ReplaceAll(url, "127.0.0.1", utils.PEER.API())
r := regexp.MustCompile("(:[0-9]+)")
ttt := r.FindAllString(url, -1)
for _, t := range ttt {
t := r.FindString(url)
if t != "" {
url = strings.Replace(url, t, ":8080", -1)
}
r.ReplaceAllString(url, ":8080")
@ -82,8 +82,8 @@ func (p *PeerCache) LaunchPeerExecution(peerID string, isMySelf bool, dataID str
url = strings.ReplaceAll(url, "localhost", dt.API())
url = strings.ReplaceAll(url, "127.0.0.1", dt.API())
r := regexp.MustCompile("(:[0-9]+)")
ttt := r.FindAllString(url, -1)
for _, t := range ttt {
t := r.FindString(url)
if t != "" {
url = strings.Replace(url, t, ":8080", -1)
}
r.ReplaceAllString(url, ":8080")