Yury Kastov
2026-03-07 13:56:11 +03:00
committed by GitHub
parent 78fc2865ea
commit eec280262d
5 changed files with 88 additions and 77 deletions
+3 -3
View File
@@ -163,12 +163,12 @@ func (m *Manager) GetChannel(name string) stats.Channel {
// GetAllOnlineUsers implements stats.Manager.
func (m *Manager) GetAllOnlineUsers() []string {
m.access.Lock()
defer m.access.Unlock()
m.access.RLock()
defer m.access.RUnlock()
usersOnline := make([]string, 0, len(m.onlineMap))
for user, onlineMap := range m.onlineMap {
if len(onlineMap.IpTimeMap()) > 0 {
if onlineMap.Count() > 0 {
usersOnline = append(usersOnline, user)
}
}