judge: 修复测试数据更新无效的问题

This commit is contained in:
undefined committed 2020-11-02 22:14:19 +08:00
1 parent 8b0870d788
commit 83d8d74715
4 files changed
+8 -5

No files matched your search

+5 -2
View File
@@ -57,9 +57,11 @@ export async function get(domainId: string, _id: ObjectID): Promise<Rdoc | null>
export async function judge(domainId: string, rid: ObjectID) {
const rdoc = await get(domainId, rid);
let config: RunConfig | ProblemConfig = rdoc.config;
if (!config) {
let data;
if (rdoc.pid) {
const pdoc = await problem.get(domainId, rdoc.pid);
config = pdoc?.config || {};
if (!config) config = pdoc?.config || {};
data = pdoc.data;
}
delete rdoc._id;
await task.add({
@@ -68,6 +70,7 @@ export async function judge(domainId: string, rid: ObjectID) {
rid,
domainId,
config,
data,
});
}