From c49a24017f05d0adef00b3cdfe159ab7f0258997 Mon Sep 17 00:00:00 2001 From: undefined Date: Sun, 13 Jun 2021 10:28:28 +0800 Subject: [PATCH] =?UTF-8?q?judge:=20=E4=BF=AE=E5=A4=8D=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E9=A2=98=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E8=AF=BB=E5=8F=96?= =?UTF-8?q?ans=E6=B5=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hydrojudge/package.json | 2 +- packages/hydrojudge/src/judge/interactive.ts | 2 +- packages/hydrojudge/src/sandbox.ts | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 461d0eb3a..eb0b97610 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.8.7", + "version": "2.8.8", "main": "package.json", "author": "undefined ", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/judge/interactive.ts b/packages/hydrojudge/src/judge/interactive.ts index 770be327a..42f31b0ad 100644 --- a/packages/hydrojudge/src/judge/interactive.ts +++ b/packages/hydrojudge/src/judge/interactive.ts @@ -26,7 +26,7 @@ function judgeCase(c) { time: ctxSubtask.subtask.time, memory: ctxSubtask.subtask.memory, }, { - execute: `${ctx.executeInteractor.execute.replace(/\$\{name\}/g, 'interactor')} /w/in /w/tout /w/tout`, + execute: `${ctx.executeInteractor.execute.replace(/\$\{name\}/g, 'interactor')} /w/in /w/tout /w/out`, copyIn: ctx.executeInteractor.copyIn, time: ctxSubtask.subtask.time * 2, memory: ctxSubtask.subtask.memory * 2, diff --git a/packages/hydrojudge/src/sandbox.ts b/packages/hydrojudge/src/sandbox.ts index fe8d7f7d7..dad31fc55 100644 --- a/packages/hydrojudge/src/sandbox.ts +++ b/packages/hydrojudge/src/sandbox.ts @@ -76,6 +76,7 @@ async function adaptResult(result, params) { export async function runMultiple(execute) { let res; + const size = parseMemoryMB(getConfig('stdio_size')); try { const body = { cmd: [ @@ -85,9 +86,15 @@ export async function runMultiple(execute) { pipeMapping: [{ in: { index: 0, fd: 1 }, out: { index: 1, fd: 0 }, + proxy: true, + name: 'stdout', + max: 1024 * 1024 * size, }, { in: { index: 1, fd: 1 }, out: { index: 0, fd: 0 }, + proxy: true, + name: 'stdout', + max: 1024 * 1024 * size, }], }; body.cmd[0].files[0] = null; @@ -105,7 +112,7 @@ export async function runMultiple(execute) { return await Promise.all(res.data.map((i) => adaptResult(i, {}))); } -export async function del(fileId) { +export async function del(fileId: string) { const res = await Axios.create({ baseURL: getConfig('sandbox_host') }).delete(`/file/${fileId}`); return res.data; }