mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-03 02:08:45 +00:00
API: Fix Online Map (#5732)
https://github.com/XTLS/Xray-core/pull/5732#pullrequestreview-3863990264
This commit is contained in:
+3
-3
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user