feat: cleanup, use bulk

This commit is contained in:
Barış Soner Uşaklı
2019-06-24 21:36:20 -04:00
parent 3ecd703ea3
commit 198d05875f
12 changed files with 63 additions and 129 deletions

View File

@@ -124,10 +124,8 @@ module.exports = function (Messaging) {
if (!inRoom) {
return next(new Error('[[error:cant-add-users-to-chat-room]]'));
}
var now = Date.now();
var timestamps = uids.map(function () {
return now;
});
const now = Date.now();
const timestamps = uids.map(() => now);
db.sortedSetAdd('chat:room:' + roomId + ':uids', timestamps, uids, next);
},
function (next) {