fix: prettier bulk method usage

isekai-main
Barış Soner Uşaklı 3 years ago committed by Julian Lam
parent 42959df053
commit 3b0c42a591

@ -117,9 +117,9 @@ module.exports = function (Messaging) {
const userCounts = await db.sortedSetsCard(roomIds.map(roomId => `chat:room:${roomId}:uids`)); const userCounts = await db.sortedSetsCard(roomIds.map(roomId => `chat:room:${roomId}:uids`));
const groupChats = roomIds.filter((roomId, index) => userCounts[index] > 2); const groupChats = roomIds.filter((roomId, index) => userCounts[index] > 2);
const privateChats = roomIds.filter((roomId, index) => userCounts[index] <= 2); const privateChats = roomIds.filter((roomId, index) => userCounts[index] <= 2);
await Promise.all([ await db.setObjectBulk([
db.setObjectBulk(groupChats.map(id => [`chat:room:${id}`, { groupChat: 1 }])), ...groupChats.map(id => [`chat:room:${id}`, { groupChat: 1 }]),
db.setObjectBulk(privateChats.map(id => [`chat:room:${id}`, { groupChat: 0 }])), ...privateChats.map(id => [`chat:room:${id}`, { groupChat: 0 }]),
]); ]);
} }

Loading…
Cancel
Save