mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: 修复交互题无法正常读取ans流的问题
This commit is contained in:
1 parent
8e0c140ef4
commit
c49a24017f
3 files changed
+10
-3
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "2.8.7",
|
"version": "2.8.8",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ function judgeCase(c) {
|
|||||||
time: ctxSubtask.subtask.time,
|
time: ctxSubtask.subtask.time,
|
||||||
memory: ctxSubtask.subtask.memory,
|
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,
|
copyIn: ctx.executeInteractor.copyIn,
|
||||||
time: ctxSubtask.subtask.time * 2,
|
time: ctxSubtask.subtask.time * 2,
|
||||||
memory: ctxSubtask.subtask.memory * 2,
|
memory: ctxSubtask.subtask.memory * 2,
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ async function adaptResult(result, params) {
|
|||||||
|
|
||||||
export async function runMultiple(execute) {
|
export async function runMultiple(execute) {
|
||||||
let res;
|
let res;
|
||||||
|
const size = parseMemoryMB(getConfig('stdio_size'));
|
||||||
try {
|
try {
|
||||||
const body = {
|
const body = {
|
||||||
cmd: [
|
cmd: [
|
||||||
@@ -85,9 +86,15 @@ export async function runMultiple(execute) {
|
|||||||
pipeMapping: [{
|
pipeMapping: [{
|
||||||
in: { index: 0, fd: 1 },
|
in: { index: 0, fd: 1 },
|
||||||
out: { index: 1, fd: 0 },
|
out: { index: 1, fd: 0 },
|
||||||
|
proxy: true,
|
||||||
|
name: 'stdout',
|
||||||
|
max: 1024 * 1024 * size,
|
||||||
}, {
|
}, {
|
||||||
in: { index: 1, fd: 1 },
|
in: { index: 1, fd: 1 },
|
||||||
out: { index: 0, fd: 0 },
|
out: { index: 0, fd: 0 },
|
||||||
|
proxy: true,
|
||||||
|
name: 'stdout',
|
||||||
|
max: 1024 * 1024 * size,
|
||||||
}],
|
}],
|
||||||
};
|
};
|
||||||
body.cmd[0].files[0] = null;
|
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, {})));
|
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}`);
|
const res = await Axios.create({ baseURL: getConfig('sandbox_host') }).delete(`/file/${fileId}`);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user