|
|
|
@ -10,10 +10,9 @@ import ( |
|
|
|
|
"sync/atomic" |
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
"github.com/go-resty/resty/v2" |
|
|
|
|
"github.com/pkg/errors" |
|
|
|
|
|
|
|
|
|
"github.com/go-kratos/kratos/v2/log" |
|
|
|
|
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
type Discovery struct { |
|
|
|
@ -444,22 +443,22 @@ func (r *Resolve) fetch(_ context.Context) (ins *disInstancesInfo, ok bool) { |
|
|
|
|
for zone, in := range appIns.Instances { |
|
|
|
|
ins.Instances[zone] = in |
|
|
|
|
} |
|
|
|
|
//if r.opt.Filter != nil {
|
|
|
|
|
// if r.opt.Filter != nil {
|
|
|
|
|
// ins.Instances = r.opt.Filter(appIns.Instances)
|
|
|
|
|
//} else {
|
|
|
|
|
// } else {
|
|
|
|
|
// ins.Instances = make(map[string][]*discoveryInstance)
|
|
|
|
|
// for zone, in := range appIns.Instances {
|
|
|
|
|
// ins.Instances[zone] = in
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
//if r.opt.scheduler != nil {
|
|
|
|
|
// }
|
|
|
|
|
// if r.opt.scheduler != nil {
|
|
|
|
|
// ins.Instances[r.opt.ClientZone] = r.opt.scheduler(ins)
|
|
|
|
|
//}
|
|
|
|
|
//if r.opt.Subset != nil && r.opt.SubsetSize != 0 {
|
|
|
|
|
// }
|
|
|
|
|
// if r.opt.Subset != nil && r.opt.SubsetSize != 0 {
|
|
|
|
|
// for zone, inss := range ins.Instances {
|
|
|
|
|
// ins.Instances[zone] = r.opt.Subset(inss, r.opt.SubsetSize)
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|