fix: #9163, fix total connection count on ACP

sockets.sockets is a JS map in 3.x
This commit is contained in:
Barış Soner Uşaklı
2021-01-04 16:58:29 -05:00
parent 87e333b44f
commit 1968bf50f1

View File

@@ -131,10 +131,10 @@ SocketRooms.getLocalStats = function () {
topics: {}, topics: {},
}; };
if (io) { if (io && io.sockets) {
socketData.onlineGuestCount = Sockets.getCountInRoom('online_guests'); socketData.onlineGuestCount = Sockets.getCountInRoom('online_guests');
socketData.onlineRegisteredCount = SocketRooms.getOnlineUserCount(io); socketData.onlineRegisteredCount = SocketRooms.getOnlineUserCount(io);
socketData.socketCount = Object.keys(io.sockets.sockets).length; socketData.socketCount = io.sockets.sockets.size;
socketData.users.categories = Sockets.getCountInRoom('categories'); socketData.users.categories = Sockets.getCountInRoom('categories');
socketData.users.recent = Sockets.getCountInRoom('recent_topics'); socketData.users.recent = Sockets.getCountInRoom('recent_topics');
socketData.users.unread = Sockets.getCountInRoom('unread_topics'); socketData.users.unread = Sockets.getCountInRoom('unread_topics');