mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix #806
This commit is contained in:
1 file changed
+9
-7
@@ -657,13 +657,15 @@ const scripts: UpgradeScript[] = [
|
|||||||
let bulk = RecordModel.collStat.initializeUnorderedBulkOp();
|
let bulk = RecordModel.collStat.initializeUnorderedBulkOp();
|
||||||
for await (const doc of cursor) {
|
for await (const doc of cursor) {
|
||||||
bulk.find({ _id: doc._id }).upsert().updateOne({
|
bulk.find({ _id: doc._id }).upsert().updateOne({
|
||||||
domainId: doc.domainId,
|
$set: {
|
||||||
pid: doc.pid,
|
domainId: doc.domainId,
|
||||||
uid: doc.uid,
|
pid: doc.pid,
|
||||||
time: doc.time,
|
uid: doc.uid,
|
||||||
memory: doc.memory,
|
time: doc.time,
|
||||||
length: doc.code?.length || 0,
|
memory: doc.memory,
|
||||||
lang: doc.lang,
|
length: doc.code?.length || 0,
|
||||||
|
lang: doc.lang,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
if (bulk.batches.length > 500) {
|
if (bulk.batches.length > 500) {
|
||||||
await bulk.execute();
|
await bulk.execute();
|
||||||
|
|||||||
Reference in new issue
Block a user