nats discovery

This commit is contained in:
mr 2024-10-17 16:05:00 +02:00
parent 3e7f8513eb
commit 73fce1d8fb

View File

@ -51,14 +51,14 @@ func (s State) String() string {
type API struct{} type API struct{}
func (a *API) Discovered() { func (a *API) Discovered(infos []*beego.ControllerInfo) {
respondToDiscovery := func(m map[string]interface{}) { respondToDiscovery := func(m map[string]interface{}) {
if len(m) == 0 { if len(m) == 0 {
a.SubscribeRouter() a.SubscribeRouter(infos)
} }
} }
a.ListenRouter(respondToDiscovery) a.ListenRouter(respondToDiscovery)
a.SubscribeRouter() a.SubscribeRouter(infos)
} }
// GetState returns the state of the API // GetState returns the state of the API