Code Review
/
ric-plt
/
rtmgr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
RIC-3057: Fix for retry in socket send
[ric-plt/rtmgr.git]
/
pkg
/
sbi
/
nngpush.go
diff --git
a/pkg/sbi/nngpush.go
b/pkg/sbi/nngpush.go
index
1404319
..
b270abf
100644
(file)
--- 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"
_ "nanomsg.org/go/mangos/v2/transport/all"
"routing-manager/pkg/rtmgr"
"strconv"
+ "time"
)
)
-
-
type NngPush struct {
Sbi
NewSocket CreateNewNngSocketHandler
type NngPush struct {
Sbi
NewSocket CreateNewNngSocketHandler
-
rcChan
chan *xapp.RMRParams
+
rcChan
chan *xapp.RMRParams
}
func NewNngPush() *NngPush {
}
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 {
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
}
}
return nil