移除多余接口

This commit is contained in:
undefined committed 2021-02-05 17:30:22 +08:00
1 parent 33aaf1f2ea
commit 0ceb095314
3 files changed
+4 -10

No files matched your search

+1 -1
View File
@@ -98,7 +98,7 @@ class SystemScriptHandler extends SystemHandler {
if (!global.Hydro.script[id]) throw new ValidationError('id');
const args = JSON.parse(raw);
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 });
report({ message: `Running script: ${id} `, status: STATUS.STATUS_JUDGING });
const start = new Date().getTime();
+2 -7
View File
@@ -260,16 +260,11 @@ export class ProblemPretestHandler extends ProblemDetailHandler {
@param('lang', Types.String)
@param('code', Types.String)
@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);
const rid = await record.add(
domainId, this.pdoc.docId, this.user._id,
lang, code, true,
{
input,
time: '1s',
memory: '512m',
},
lang, code, true, input,
);
const rdoc = await record.get(domainId, rid);
bus.boardcast('record/change', rdoc);
+1 -2
View File
@@ -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 config: RunConfig | ProblemConfig = rdoc.config || {};
let data = [];
if (rdoc.pid) {
const pdoc = await problem.get(domainId, rdoc.pid);