mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 17:36:14 -04:00
Revert "PadMessageHandler: Use a Map
for sessioninfos
"
Switching to a Map broke ep_webrtc and maybe other plugins.
This reverts commit eeead46437
.
This commit is contained in:
parent
3c087af038
commit
b040ebf419
2 changed files with 37 additions and 28 deletions
|
@ -810,12 +810,15 @@ exports.createDiffHTML = async (padID, startRev, endRev) => {
|
|||
|
||||
exports.getStats = async () => {
|
||||
const sessionInfos = padMessageHandler.sessioninfos;
|
||||
const map = function* (it, fn) { for (const i of it) yield fn(i); };
|
||||
const activePads = new Set(map(sessionInfos.values(), ({padId}) => padId));
|
||||
|
||||
const sessionKeys = Object.keys(sessionInfos);
|
||||
const activePads = new Set(Object.entries(sessionInfos).map((k) => k[1].padId));
|
||||
|
||||
const {padIDs} = await padManager.listAllPads();
|
||||
|
||||
return {
|
||||
totalPads: padIDs.length,
|
||||
totalSessions: sessionInfos.size,
|
||||
totalSessions: sessionKeys.length,
|
||||
totalActivePads: activePads.size,
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue