judge: support run

pull/140/head
undefined 3 years ago
parent 19e14fc90f
commit 5b92200108

@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.6.3",
"version": "2.6.4",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",

@ -70,7 +70,8 @@ class JudgeTask {
tmpfs.mount(this.tmpdir, '512m');
log.info('Submission: %s/%s/%s pid=%s', this.host, this.domainId, this.rid, this.pid);
try {
await this.doSubmission();
if (typeof this.input === 'string') await this.run();
else await this.doSubmission();
} catch (e) {
if (e instanceof CompileError) {
this.next({ compiler_text: compilerText(e.stdout, e.stderr) });
@ -96,6 +97,11 @@ class JudgeTask {
fs.removeSync(this.tmpdir);
}
async run() {
this.stat.judge = new Date();
await judge.run.judge(this);
}
async doSubmission() {
this.stat.cache_start = new Date();
this.folder = await this.session.cacheOpen(this.domainId, this.pid, this.data, this.next);

Loading…
Cancel
Save