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

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.1.18",
"version": "2.1.19",
"main": "package.json",
"author": "masnn",
"repository": "https://github.com/hydro-dev/Hydro.git",
+1 -1
View File
@@ -207,7 +207,7 @@ async function postInit() {
this.domainId = this.request.domainId;
this.lang = this.request.lang;
this.code = this.request.code;
this.data = this.request.data;
this.data = this.request.data.toString();
this.config = this.request.config;
this.next = getNext(this);
this.end = getEnd(this.domainId, this.rid);
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.13.34",
"version": "2.13.35",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+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,
});
}