mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-30 18:46:01 +01:00 
			
		
		
		
	fix: one more upgrade script fix
This commit is contained in:
		| @@ -20,10 +20,14 @@ module.exports = { | ||||
|  | ||||
| 		// calculate user count and set progress.total | ||||
| 		await batch.processArray(allRoomIds, async (roomIds) => { | ||||
| 			await Promise.all(roomIds.map(async (roomId) => { | ||||
| 				const userCount = await db.sortedSetCard(`chat:room:${roomId}:uids`); | ||||
| 				await db.setObjectField(`chat:room:${roomId}`, 'userCount', userCount); | ||||
| 				progress.total += userCount; | ||||
| 			const arrayOfRoomData = await db.getObjects(roomIds.map(roomId => `chat:room:${roomId}`)); | ||||
| 			await Promise.all(roomIds.map(async (roomId, idx) => { | ||||
| 				const roomData = arrayOfRoomData[idx]; | ||||
| 				if (roomData) { | ||||
| 					const userCount = await db.sortedSetCard(`chat:room:${roomId}:uids`); | ||||
| 					await db.setObjectField(`chat:room:${roomId}`, 'userCount', userCount); | ||||
| 					progress.total += userCount; | ||||
| 				} | ||||
| 			})); | ||||
| 		}, { | ||||
| 			batch: 500, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user