mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core: fix
This commit is contained in:
2 files changed
+5
-3
No files matched your search
@@ -153,6 +153,8 @@ export default class RecordModel {
|
|||||||
data.input = args.input || '';
|
data.input = args.input || '';
|
||||||
isContest = false;
|
isContest = false;
|
||||||
data.contest = RecordModel.RECORD_PRETEST;
|
data.contest = RecordModel.RECORD_PRETEST;
|
||||||
|
} else if (args.type === 'generate') {
|
||||||
|
data.contest = RecordModel.RECORD_GENERATE;
|
||||||
}
|
}
|
||||||
const res = await RecordModel.coll.insertOne(data);
|
const res = await RecordModel.coll.insertOne(data);
|
||||||
bus.broadcast('record/change', data);
|
bus.broadcast('record/change', data);
|
||||||
@@ -265,7 +267,7 @@ export function apply(ctx: Context) {
|
|||||||
uid: rdoc.uid,
|
uid: rdoc.uid,
|
||||||
time: rdoc.time,
|
time: rdoc.time,
|
||||||
memory: rdoc.memory,
|
memory: rdoc.memory,
|
||||||
code: rdoc.code?.length || 0,
|
length: rdoc.code?.length || 0,
|
||||||
lang: rdoc.lang,
|
lang: rdoc.lang,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -284,7 +286,7 @@ export function apply(ctx: Context) {
|
|||||||
{ key: { domainId: 1, pid: 1, uid: 1, _id: -1 }, name: 'basic' },
|
{ key: { domainId: 1, pid: 1, uid: 1, _id: -1 }, name: 'basic' },
|
||||||
{ key: { domainId: 1, pid: 1, uid: 1, time: 1 }, name: 'time' },
|
{ key: { domainId: 1, pid: 1, uid: 1, time: 1 }, name: 'time' },
|
||||||
{ key: { domainId: 1, pid: 1, uid: 1, memory: 1 }, name: 'memory' },
|
{ key: { domainId: 1, pid: 1, uid: 1, memory: 1 }, name: 'memory' },
|
||||||
{ key: { domainId: 1, pid: 1, uid: 1, code: 1 }, name: 'code' },
|
{ key: { domainId: 1, pid: 1, uid: 1, length: 1 }, name: 'length' },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -660,7 +660,7 @@ const scripts: UpgradeScript[] = [
|
|||||||
uid: doc.uid,
|
uid: doc.uid,
|
||||||
time: doc.time,
|
time: doc.time,
|
||||||
memory: doc.memory,
|
memory: doc.memory,
|
||||||
code: doc.code?.length || 0,
|
length: doc.code?.length || 0,
|
||||||
lang: doc.lang,
|
lang: doc.lang,
|
||||||
});
|
});
|
||||||
if (bulk.length > 500) {
|
if (bulk.length > 500) {
|
||||||
|
|||||||
Reference in new issue
Block a user