mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
judge: support run
This commit is contained in:
1 parent
19e14fc90f
commit
5b92200108
2 files changed
+8
-2
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user