judge: 可调的性能设置

This commit is contained in:
undefined committed 2021-01-21 22:56:35 +08:00
1 parent 8c8dcb89eb
commit 2bf1a18890
21 files changed
+237 -274

No files matched your search

+2 -3
View File
@@ -4,13 +4,12 @@ import { run, del } from './sandbox';
import { CompileError, SystemError } from './error';
import { compilerText } from './utils';
import { Execute } from './interface';
import { getConfig } from './config';
export = async function compile(
lang: string, code: string, target: string, copyIn: any, next?: Function,
): Promise<Execute> {
const LANGS = global.Hydro
? yaml.load(global.Hydro.model.system.get('hydrojudge.langs'))
: require('./config').LANGS;
const LANGS = yaml.load(getConfig('langs'));
if (!LANGS[lang]) throw new SystemError('Unsupported language {0}.', [lang]);
const info = LANGS[lang];
target = info.target || target;