judge: add debug info

This commit is contained in:
undefined committed 2021-07-31 13:22:44 +08:00
1 parent 0c95620fa0
commit bedbe954ed
3 files changed
+7 -3

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.9.1",
"version": "2.9.2",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+3 -1
View File
@@ -114,7 +114,9 @@ class JudgeTask {
{ next: this.next, key: md5(`${this.domainId}${this.pid}${getConfig('secret')}`) },
);
this.stat.judge = new Date();
await judge[this.config.type || 'default'].judge(this);
const type = this.config.type || 'default';
if (!judge[type]) throw new FormatError('Unrecognized problemType: {0}', [type]);
await judge[type].judge(this);
}
next(data, id?: number) {
+3 -1
View File
@@ -237,7 +237,9 @@ async function postInit() {
{ next: this.next, key: md5(`${this.domainId}${this.pid}${getConfig('secret')}`) },
);
this.stat.judge = new Date();
await judge[this.config.type || 'default'].judge(this);
const type = this.config.type || 'default';
if (!judge[type]) throw new FormatError('Unrecognized problemType: {0}', [type]);
await judge[type].judge(this);
}
async run() {