judge: fix pretest for standalone judge

This commit is contained in:
undefined committed 2021-04-23 12:27:30 +08:00
1 parent ecc1e10664
commit c86b063415
4 files changed
+4 -16

No files matched your search

+1 -13
View File
@@ -67,8 +67,7 @@ class JudgeTask {
tmpfs.mount(this.tmpdir, '512m');
log.info('Submission: %s/%s/%s pid=%s', this.host, this.domainId, this.rid, this.pid);
try {
if (this.input) await this.doPretest();
else await this.doSubmission();
await this.doSubmission();
} catch (e) {
if (e instanceof CompileError) {
this.next({ compiler_text: compilerText(e.stdout, e.stderr) });
@@ -107,17 +106,6 @@ class JudgeTask {
await judge[this.config.type || 'default'].judge(this);
}
async doPretest() {
this.folder = path.resolve(this.tmpdir, 'data');
await this.session.recordPretestData(this.rid, this.folder);
this.config = await readCases(
this.folder,
{ detail: this.session.config.detail },
{ next: this.next },
);
await judge[this.config.type || 'default'].judge(this);
}
next(data, id?: number) {
log.debug('Next: %d %o', id, data);
data.key = 'next';