core&judge: allow performance mode

This commit is contained in:
undefined committed 2023-02-24 19:26:41 +08:00
1 parent 080621738e
commit 4adf05c50b
5 files changed
+41 -32

No files matched your search

+7 -1
View File
@@ -155,13 +155,19 @@ export default class Hydro {
getNext(t: JudgeTask) {
return (data: Partial<JudgeResultBody>) => {
log.debug('Next: %o', data);
this.send(t.request.rid, 'next', data);
if (getConfig('performance') && data.case && !data.compilerText && !data.message) {
t.callbackCache ||= [];
t.callbackCache.push(data.case);
} else {
this.send(t.request.rid, 'next', data);
}
};
}
getEnd(t: JudgeTask) {
return (data: Partial<JudgeResultBody>) => {
log.info('End: %o', data);
if (t.callbackCache) data.cases = t.callbackCache;
this.send(t.request.rid, 'end', data);
};
}