X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fsbi%2Fnngpush.go;h=b270abfb9cedf0326deb25d2439f8892a3df761b;hb=0e38e1ba0b4df4e65b60ed45ed9a6638bcda44c1;hp=140431961eef58851df3499545660bd80c1a8707;hpb=cb93dbf2fac19dd49332847327b364be27d8bb71;p=ric-plt%2Frtmgr.git diff --git a/pkg/sbi/nngpush.go b/pkg/sbi/nngpush.go index 1404319..b270abf 100644 --- a/pkg/sbi/nngpush.go +++ b/pkg/sbi/nngpush.go @@ -50,14 +50,13 @@ import ( _ "nanomsg.org/go/mangos/v2/transport/all" "routing-manager/pkg/rtmgr" "strconv" + "time" ) - - type NngPush struct { Sbi NewSocket CreateNewNngSocketHandler - rcChan chan *xapp.RMRParams + rcChan chan *xapp.RMRParams } func NewNngPush() *NngPush { @@ -150,10 +149,16 @@ func (c *NngPush) DistributeAll(policies *[]string) error { xapp.Logger.Debug("Invoked: sbi.DistributeAll") xapp.Logger.Debug("args: %v", *policies) for _, ep := range rtmgr.Eps { - if ep.IsReady { - go c.send(ep, policies) - } else { - xapp.Logger.Warn("Endpoint " + ep.Uuid + " is not ready") + i := 1 + for i < 5 { + if ep.IsReady { + go c.send(ep, policies) + break + } else { + xapp.Logger.Warn("Endpoint " + ep.Uuid + " is not ready" + " Retry count " + strconv.Itoa(i)) + time.Sleep(10 * time.Millisecond) + i++ + } } } return nil