Observatory: Fix consuming 100% CPU when no outbound matches subjectSelector (#6669)

Fixes https://github.com/XTLS/Xray-core/issues/6666
This commit is contained in:
风扇滑翔翼
2026-08-25 18:30:33 +00:00
committed by GitHub
parent 598bde7412
commit f124daf5a3
+6
View File
@@ -78,6 +78,12 @@ func (o *Observer) background() {
sleepTime = time.Duration(o.config.ProbeInterval)
}
if len(outbounds) == 0 {
errors.LogWarning(o.ctx, "no outbound matches subjectSelector ", o.config.SubjectSelector)
time.Sleep(sleepTime)
continue
}
if !o.config.EnableConcurrency {
sort.Strings(outbounds)
for _, v := range outbounds {