mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
move delarations to @hydrooj/common
This commit is contained in:
1 parent
100ccf718f
commit
4a33816a37
49 files changed
+496
-465
No files matched your search
@@ -36,18 +36,16 @@ const session: Session = {
|
||||
t._callbackAwait ||= Promise.resolve();
|
||||
return (data: Partial<JudgeResultBody>) => {
|
||||
logger.debug('Next: %o', data);
|
||||
data.rid = new ObjectId(t.rid);
|
||||
if (data.case) data.case.message ||= '';
|
||||
t._callbackAwait = t._callbackAwait.then(() => JudgeHandler.next({ ...data, domainId: t.request.domainId }));
|
||||
t._callbackAwait = t._callbackAwait.then(() => JudgeHandler.next({ ...data, rid: t.rid, domainId: t.request.domainId }));
|
||||
};
|
||||
},
|
||||
getEnd(t: Context) {
|
||||
t._callbackAwait ||= Promise.resolve();
|
||||
return (data: Partial<JudgeResultBody>) => {
|
||||
data.key = 'end';
|
||||
data.rid = new ObjectId(t.rid);
|
||||
logger.info('End: status=%d score=%d time=%dms memory=%dkb', data.status, data.score, data.time, data.memory);
|
||||
t._callbackAwait = t._callbackAwait.then(() => JudgeHandler.end({ ...data, domainId: t.request.domainId }));
|
||||
t._callbackAwait = t._callbackAwait.then(() => JudgeHandler.end({ ...data, rid: t.rid, domainId: t.request.domainId }));
|
||||
};
|
||||
},
|
||||
getLang(lang: string, doThrow = true) {
|
||||
|
||||
@@ -4,10 +4,8 @@ import AdmZip from 'adm-zip';
|
||||
import PQueue from 'p-queue';
|
||||
import superagent from 'superagent';
|
||||
import WebSocket from 'ws';
|
||||
import { JudgeResultBody, parseLang, STATUS } from '@hydrooj/common';
|
||||
import { fs, noop } from '@hydrooj/utils';
|
||||
import { parseLang } from '@hydrooj/utils/lib/lang';
|
||||
import { STATUS } from '@hydrooj/utils/lib/status';
|
||||
import type { JudgeResultBody } from 'hydrooj';
|
||||
import { getConfig } from '../config';
|
||||
import { FormatError, SystemError } from '../error';
|
||||
import { Session } from '../interface';
|
||||
|
||||
Reference in new issue
Block a user