mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 23:47:07 -05:00
return zero length value when observer is not found
This commit is contained in:
parent
1de2466c60
commit
44040ca684
@ -144,13 +144,15 @@ func (s *LeastLoadStrategy) getNodes(candidates []string, maxRTT time.Duration)
|
|||||||
if s.settings.ObserverTag == "" {
|
if s.settings.ObserverTag == "" {
|
||||||
observeResult, err := s.observer.GetObservation(s.ctx)
|
observeResult, err := s.observer.GetObservation(s.ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newError("cannot get observation").Base(err)
|
newError("cannot get observation").Base(err).WriteToLog()
|
||||||
|
return make([]*node, 0)
|
||||||
}
|
}
|
||||||
result = observeResult
|
result = observeResult
|
||||||
} else {
|
} else {
|
||||||
observeResult, err := common.Must2(s.observer.(features.TaggedFeatures).GetFeaturesByTag(s.settings.ObserverTag)).(extension.Observatory).GetObservation(s.ctx)
|
observeResult, err := common.Must2(s.observer.(features.TaggedFeatures).GetFeaturesByTag(s.settings.ObserverTag)).(extension.Observatory).GetObservation(s.ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newError("cannot get observation").Base(err)
|
newError("cannot get observation").Base(err).WriteToLog()
|
||||||
|
return make([]*node, 0)
|
||||||
}
|
}
|
||||||
result = observeResult
|
result = observeResult
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user