mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
core&judge: allow performance mode
This commit is contained in:
1 parent
080621738e
commit
4adf05c50b
5 files changed
+41
-32
No files matched your search
@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user