judge: fix

This commit is contained in:
undefined committed 2021-06-12 23:58:33 +08:00
1 parent a24c724fb7
commit 4da505a955
3 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.8.6",
"version": "2.8.7",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+2 -2
View File
@@ -41,7 +41,7 @@ function judgeCase(c) {
status = STATUS.STATUS_TIME_LIMIT_EXCEEDED;
} else if (memory_usage_kb > ctxSubtask.subtask.memory * 1024) {
status = STATUS.STATUS_MEMORY_LIMIT_EXCEEDED;
} else if (code !== 13/* Broken Pipe */ || (code === 13 && !resInteractor.code)) {
} else if ((code && code !== 13/* Broken Pipe */) || (code === 13 && !resInteractor.code)) {
status = STATUS.STATUS_RUNTIME_ERROR;
if (code < 32) message = signals[code];
else message = { message: 'Your program returned {0}.', params: [code] };
@@ -50,7 +50,7 @@ function judgeCase(c) {
status = result.status;
score = result.score;
message = result.message;
if (resInteractor.code) message += ` (Interactor exited with code ${resInteractor.code})`;
if (resInteractor.code && resInteractor.code !== 1) message += ` (Interactor exited with code ${resInteractor.code})`;
}
ctxSubtask.score = Score[ctxSubtask.subtask.type](ctxSubtask.score, score);
ctxSubtask.status = Math.max(ctxSubtask.status, status);
+4 -4
View File
@@ -95,9 +95,9 @@ export async function runMultiple(execute) {
body.cmd[1].files[0] = null;
body.cmd[1].files[1] = null;
const id = callId++;
if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(body));
if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(body));
res = await Axios.create({ baseURL: getConfig('sandbox_host') }).post('/run', body);
if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(res.data));
if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(res.data));
} catch (e) {
if (e instanceof FormatError) throw e;
throw new SystemError('Sandbox Error');
@@ -123,9 +123,9 @@ export async function run(execute, params?) {
}
const body = { cmd: [proc({ execute, ...params })] };
const id = callId++;
if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(body));
if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(body));
const res = await Axios.create({ baseURL: getConfig('sandbox_host') }).post('/run', body);
if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(res.data));
if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(res.data));
[result] = res.data;
} catch (e) {
if (e instanceof FormatError) throw e;