mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	feat: remove duped zadds, these are already in topics.onNewPostMade
This commit is contained in:
		| @@ -209,14 +209,7 @@ module.exports = function (Categories) { | ||||
|  | ||||
| 		async.parallel([ | ||||
| 			function (next) { | ||||
| 				const bulk = [ | ||||
| 					['cid:' + cid + ':pids', postData.timestamp, postData.pid], | ||||
| 					['cid:' + cid + ':tids:lastposttime', postData.timestamp, postData.tid], | ||||
| 				]; | ||||
| 				if (!pinned) { | ||||
| 					bulk.push(['cid:' + cid + ':tids', postData.timestamp, postData.tid]); | ||||
| 				} | ||||
| 				db.sortedSetAddBulk(bulk, next); | ||||
| 				db.sortedSetAdd('cid:' + cid + ':pids', postData.timestamp, postData.pid, next); | ||||
| 			}, | ||||
| 			function (next) { | ||||
| 				db.incrObjectField('category:' + cid, 'post_count', next); | ||||
|   | ||||
| @@ -83,11 +83,6 @@ module.exports = function (db, module) { | ||||
| 		data.forEach(function (item) { | ||||
| 			bulk.find({ _key: item[0], value: String(item[2]) }).upsert().updateOne({ $set: { score: parseFloat(item[1]) } }); | ||||
| 		}); | ||||
| 		bulk.execute(function (err) { | ||||
| 			if (err) { | ||||
| 				console.log(data); | ||||
| 			} | ||||
| 			callback(err); | ||||
| 		}); | ||||
| 		bulk.execute(err => callback(err)); | ||||
| 	}; | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user