Skip to content

Commit

Permalink
update chat_upgrades.js
Browse files Browse the repository at this point in the history
changed log positions
  • Loading branch information
anika3943 committed Jan 24, 2025
1 parent a78cea3 commit 143e65a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/upgrades/1.0.0/chat_upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ module.exports = {
let roomId = globalData.nextChatRoomId || 1;

Check failure on line 17 in src/upgrades/1.0.0/chat_upgrade.js

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 3 tabs but found 12 spaces

Check failure on line 17 in src/upgrades/1.0.0/chat_upgrade.js

View workflow job for this annotation

GitHub Actions / test

'roomId' is never reassigned. Use 'const' instead
let currentMid = 1;

console.log('Anika Sharma')

function addMessageToUids(message, roomId, msgTime, currentMid, callback) {
async.parallel([
function (next) { db.sortedSetAdd(`uid:${message.fromuid}:chat:room:${roomId}:mids`, msgTime, currentMid, next); },
Expand All @@ -35,6 +33,7 @@ module.exports = {
function (next) { addMessageToUids(message, roomId, msgTime, currentMid, next); },
], (err) => {
if (!err) {
console.log('Anika Sharma')
rooms[[message.fromuid, message.touid].sort().join(':')] = roomId;
roomId += 1;
db.setObjectField('global', 'nextChatRoomId', roomId, callback);
Expand All @@ -56,6 +55,7 @@ module.exports = {
if (rooms[pairID]) {
winston.verbose(`adding message ${currentMid} to existing roomID ${rooms[pairID]}`);
addMessageToUids(message, rooms[pairID], msgTime, currentMid, callback);
console.log('Anika Sharma')
} else {
winston.verbose(`adding message ${currentMid} to new roomID ${roomId}`);
createNewRoom(message, roomId, msgTime, currentMid, rooms, callback);
Expand Down Expand Up @@ -84,8 +84,6 @@ module.exports = {
}

processMessages(currentMid, globalData, callback);

console.log('Anika Sharma')
});
},
};

0 comments on commit 143e65a

Please sign in to comment.