From bff5c0810147f59c0a88de7b701d55e985263c15 Mon Sep 17 00:00:00 2001 From: undefined Date: Sat, 14 Nov 2020 12:43:14 +0800 Subject: [PATCH] =?UTF-8?q?judge:=20=E4=BF=AE=E5=A4=8D=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=82=B9=E9=97=B4copyIn=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hydrojudge/package.json | 2 +- packages/hydrojudge/src/judge/default.ts | 4 ++-- packages/hydrojudge/src/judge/run.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 9ebfffd09..0dc308558 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.1.24", + "version": "2.1.25", "main": "package.json", "author": "masnn", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/judge/default.ts b/packages/hydrojudge/src/judge/default.ts index ce33e0e6f..dc0f33c9f 100644 --- a/packages/hydrojudge/src/judge/default.ts +++ b/packages/hydrojudge/src/judge/default.ts @@ -19,7 +19,7 @@ const Score = { function judgeCase(c) { return async (ctx, ctxSubtask) => { const { filename } = ctx.config; - const { copyIn } = ctx.execute; + const copyIn = { ...ctx.execute.copyIn }; if (filename) copyIn[`${filename}.in`] = { src: c.input }; const copyOut = filename ? [`${filename}.out`] : []; const stdin = filename ? null : c.input; @@ -144,7 +144,7 @@ export const judge = async (ctx) => { ctx.total_memory_usage_kb = 0; ctx.total_time_usage_ms = 0; // sandbox seems cannot handle concurrent tasks with output file correctly - ctx.queue = new Queue({ concurrency: ctx.config.concurrency || (ctx.config.filename ? 1 : 2) }); + ctx.queue = new Queue({ concurrency: ctx.config.concurrency || 2 }); for (const sid in ctx.config.subtasks) tasks.push(judgeSubtask(ctx.config.subtasks[sid])(ctx)); await Promise.all(tasks); ctx.stat.done = new Date(); diff --git a/packages/hydrojudge/src/judge/run.ts b/packages/hydrojudge/src/judge/run.ts index 7c8c5e0b3..193d348b2 100644 --- a/packages/hydrojudge/src/judge/run.ts +++ b/packages/hydrojudge/src/judge/run.ts @@ -12,7 +12,7 @@ export const judge = async (ctx) => { ctx.execute = await compile(ctx.lang, ctx.code, 'code', {}, ctx.next); ctx.clean.push(ctx.execute.clean); ctx.next({ status: STATUS.STATUS_JUDGING, progress: 0 }); - const { copyIn } = ctx.execute; + const copyIn = { ...ctx.execute.copyIn }; const stdin = path.resolve(ctx.tmpdir, 'stdin'); const stdout = path.resolve(ctx.tmpdir, 'stdout'); const stderr = path.resolve(ctx.tmpdir, 'stderr');