1
0
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:
Shelikhoo 2021-06-19 11:24:02 +01:00
parent 1de2466c60
commit 44040ca684
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -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
}