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

+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() {