Compare commits

..
Author SHA1 Message Date
Fangliding c244b0d8d5 Fix oberver consume 100% cpu if no outbound selected 2026-08-23 23:08:20 +08:00
2 changed files with 6 additions and 7 deletions
+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 {
-7
View File
@@ -121,13 +121,6 @@ func (s *Server) Process(ctx context.Context, network net.Network, conn stat.Con
writer: conn,
addr: addr.NetAddr(),
}
ctx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{
From: conn.RemoteAddr(),
To: addr,
Status: log.AccessAccepted,
Reason: "",
Email: inbound.User.Email,
})
return dispatcher.DispatchLink(ctx, *addr, &transport.Link{
Reader: reader,