loop on discovery
This commit is contained in:
@@ -61,9 +61,13 @@ func (s State) String() string {
|
||||
type API struct{}
|
||||
|
||||
func (a *API) Discovered(infos []*beego.ControllerInfo) {
|
||||
respondToDiscovery := func(m NATSResponse) {
|
||||
respondToDiscovery := func(resp NATSResponse) {
|
||||
var m map[string]interface{}
|
||||
json.Unmarshal(resp.Payload, &m)
|
||||
if len(m) == 0 {
|
||||
a.SubscribeRouter(infos)
|
||||
}
|
||||
}
|
||||
a.ListenRouter(respondToDiscovery)
|
||||
a.SubscribeRouter(infos)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user