mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
chore: eslint max-len
This commit is contained in:
committed by
Julian Lam
parent
5c2f0f0557
commit
cc9d6fd08b
@@ -95,7 +95,9 @@ module.exports = function (module) {
|
||||
const batch = require('../../batch');
|
||||
const batchSize = Math.ceil(key.length / Math.ceil(key.length / 100));
|
||||
await batch.processArray(key, async currentBatch => batches.push(currentBatch), { batch: batchSize });
|
||||
const batchData = await Promise.all(batches.map(batch => doQuery({ $in: batch }, { _id: 0, _key: 0 }, 0, stop + 1)));
|
||||
const batchData = await Promise.all(batches.map(
|
||||
batch => doQuery({ $in: batch }, { _id: 0, _key: 0 }, 0, stop + 1)
|
||||
));
|
||||
result = dbHelpers.mergeBatch(batchData, 0, stop, sort);
|
||||
if (start > 0) {
|
||||
result = result.slice(start, stop !== -1 ? stop + 1 : undefined);
|
||||
|
||||
@@ -65,7 +65,10 @@ module.exports = function (module) {
|
||||
|
||||
const bulk = module.client.collection('objects').initializeUnorderedBulkOp();
|
||||
for (let i = 0; i < keys.length; i += 1) {
|
||||
bulk.find({ _key: keys[i], value: value }).upsert().updateOne({ $set: { score: parseFloat(isArrayOfScores ? scores[i] : scores) } });
|
||||
bulk
|
||||
.find({ _key: keys[i], value: value })
|
||||
.upsert()
|
||||
.updateOne({ $set: { score: parseFloat(isArrayOfScores ? scores[i] : scores) } });
|
||||
}
|
||||
await bulk.execute();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user