core: fix argument validation for script

This commit is contained in:
undefined committed 2021-04-21 13:33:07 +08:00
1 parent 61597151a8
commit c43663a1d1
5 files changed
+5 -13

No files matched your search

+1 -1
View File
@@ -108,7 +108,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, '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();