diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index dd605190d..ac2c84ca1 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.6.3", + "version": "2.6.4", "main": "package.json", "author": "undefined ", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/hosts/hydro.ts b/packages/hydrojudge/src/hosts/hydro.ts index f60cb8492..08bcccc2a 100644 --- a/packages/hydrojudge/src/hosts/hydro.ts +++ b/packages/hydrojudge/src/hosts/hydro.ts @@ -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);