mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
移除多余接口
This commit is contained in:
1 parent
33aaf1f2ea
commit
0ceb095314
3 files changed
+4
-10
No files matched your search
@@ -98,7 +98,7 @@ class SystemScriptHandler extends SystemHandler {
|
|||||||
if (!global.Hydro.script[id]) throw new ValidationError('id');
|
if (!global.Hydro.script[id]) throw new ValidationError('id');
|
||||||
const args = JSON.parse(raw);
|
const args = JSON.parse(raw);
|
||||||
validate(global.Hydro.script[id].validate, args);
|
validate(global.Hydro.script[id].validate, args);
|
||||||
const rid = await record.add(domainId, -1, this.user._id, '-', id, false, { input: 'raw' });
|
const rid = await record.add(domainId, -1, this.user._id, '-', id, false, 'raw');
|
||||||
const report = (data) => judge.next({ domainId, rid, ...data });
|
const report = (data) => judge.next({ domainId, rid, ...data });
|
||||||
report({ message: `Running script: ${id} `, status: STATUS.STATUS_JUDGING });
|
report({ message: `Running script: ${id} `, status: STATUS.STATUS_JUDGING });
|
||||||
const start = new Date().getTime();
|
const start = new Date().getTime();
|
||||||
|
|||||||
@@ -260,16 +260,11 @@ export class ProblemPretestHandler extends ProblemDetailHandler {
|
|||||||
@param('lang', Types.String)
|
@param('lang', Types.String)
|
||||||
@param('code', Types.String)
|
@param('code', Types.String)
|
||||||
@param('input', Types.String, true)
|
@param('input', Types.String, true)
|
||||||
async post(domainId: string, lang: string, code: string, input: string = '') {
|
async post(domainId: string, lang: string, code: string, input = '') {
|
||||||
this.limitRate('add_record', 3600, 100);
|
this.limitRate('add_record', 3600, 100);
|
||||||
const rid = await record.add(
|
const rid = await record.add(
|
||||||
domainId, this.pdoc.docId, this.user._id,
|
domainId, this.pdoc.docId, this.user._id,
|
||||||
lang, code, true,
|
lang, code, true, input,
|
||||||
{
|
|
||||||
input,
|
|
||||||
time: '1s',
|
|
||||||
memory: '512m',
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
const rdoc = await record.get(domainId, rid);
|
const rdoc = await record.get(domainId, rid);
|
||||||
bus.boardcast('record/change', rdoc);
|
bus.boardcast('record/change', rdoc);
|
||||||
|
|||||||
@@ -72,9 +72,8 @@ export async function stat(domainId?: string) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function judge(domainId: string, rid: ObjectID, priority = 1) {
|
export async function judge(domainId: string, rid: ObjectID, priority = 1, config: ProblemConfig = {}) {
|
||||||
const rdoc = await get(domainId, rid);
|
const rdoc = await get(domainId, rid);
|
||||||
const config: RunConfig | ProblemConfig = rdoc.config || {};
|
|
||||||
let data = [];
|
let data = [];
|
||||||
if (rdoc.pid) {
|
if (rdoc.pid) {
|
||||||
const pdoc = await problem.get(domainId, rdoc.pid);
|
const pdoc = await problem.get(domainId, rdoc.pid);
|
||||||
|
|||||||
Reference in new issue
Block a user