perf: optimize throughput and scheduler efficency

This commit is contained in:
xboard
2026-03-23 14:46:43 +08:00
parent 4f1f41aa5d
commit e8e2abbc37
4 changed files with 135 additions and 46 deletions
+11
View File
@@ -62,6 +62,17 @@ func (l *Limiter) Check(conns []kernel.Connection) []KickAction {
l.mu.RLock()
defer l.mu.RUnlock()
hasDeviceLimit := false
for _, u := range l.users {
if u.DeviceLimit > 0 {
hasDeviceLimit = true
break
}
}
if !hasDeviceLimit {
return nil
}
var kicks []KickAction
// Device limit check