Skip to content

Commit

Permalink
add healthy for subscribe struct (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
binbin0325 authored Jan 24, 2022
1 parent 7781323 commit 05958d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
22 changes: 12 additions & 10 deletions clients/naming_client/subscribe_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,18 @@ func (ed *SubscribeCallback) ServiceChanged(service *model.Service) {
return
}
for _, host := range service.Hosts {
var subscribeService model.SubscribeService
subscribeService.Valid = host.Valid
subscribeService.Port = host.Port
subscribeService.Ip = host.Ip
subscribeService.Metadata = host.Metadata
subscribeService.ServiceName = host.ServiceName
subscribeService.ClusterName = host.ClusterName
subscribeService.Weight = host.Weight
subscribeService.InstanceId = host.InstanceId
subscribeService.Enable = host.Enable
subscribeService := model.SubscribeService{
Valid: host.Valid,
Port: host.Port,
Ip: host.Ip,
Metadata: host.Metadata,
ServiceName: host.ServiceName,
ClusterName: host.ClusterName,
Weight: host.Weight,
InstanceId: host.InstanceId,
Enable: host.Enable,
Healthy: host.Healthy,
}
subscribeServices = append(subscribeServices, subscribeService)
}
(*funcItem)(subscribeServices, nil)
Expand Down
1 change: 1 addition & 0 deletions model/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ type SubscribeService struct {
ServiceName string `json:"serviceName"`
Valid bool `json:"valid"`
Weight float64 `json:"weight"`
Healthy bool `json:"healthy"`
}

type BeatInfo struct {
Expand Down

0 comments on commit 05958d8

Please sign in to comment.