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:
风扇滑翔翼 authored and nerpa committed 2026-09-13 10:49:22 +03:00
1 parent 131e952bcd
commit 3dc75cdc08
1 file changed
+6
+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 {