mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 17:46:58 -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 == "" {
|
||||
observeResult, err := s.observer.GetObservation(s.ctx)
|
||||
if err != nil {
|
||||
newError("cannot get observation").Base(err)
|
||||
newError("cannot get observation").Base(err).WriteToLog()
|
||||
return make([]*node, 0)
|
||||
}
|
||||
result = observeResult
|
||||
} else {
|
||||
observeResult, err := common.Must2(s.observer.(features.TaggedFeatures).GetFeaturesByTag(s.settings.ObserverTag)).(extension.Observatory).GetObservation(s.ctx)
|
||||
if err != nil {
|
||||
newError("cannot get observation").Base(err)
|
||||
newError("cannot get observation").Base(err).WriteToLog()
|
||||
return make([]*node, 0)
|
||||
}
|
||||
result = observeResult
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user