mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: limit output length
This commit is contained in:
1 parent
aabc4c432f
commit
350716092a
3 files changed
+3
-2
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.10.1",
|
"version": "2.10.2",
|
||||||
"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",
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ const checkers: Record<string, Checker> = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else status = STATUS.STATUS_ACCEPTED;
|
} else status = STATUS.STATUS_ACCEPTED;
|
||||||
|
if (message.length > 1024000) message = '';
|
||||||
return {
|
return {
|
||||||
score: status === STATUS.STATUS_ACCEPTED ? config.score : 0,
|
score: status === STATUS.STATUS_ACCEPTED ? config.score : 0,
|
||||||
status,
|
status,
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ export const judge = async (ctx) => {
|
|||||||
status,
|
status,
|
||||||
time_ms: time_usage_ms,
|
time_ms: time_usage_ms,
|
||||||
memory_kb: memory_usage_kb,
|
memory_kb: memory_usage_kb,
|
||||||
message: message.join('\n'),
|
message: message.join('\n').substr(0, 1024000),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
ctx.stat.done = new Date();
|
ctx.stat.done = new Date();
|
||||||
|
|||||||
Reference in new issue
Block a user