mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 01:38:19 +08:00
judge: add compile_time_limit option
This commit is contained in:
1 file changed
+4
@@ -23,8 +23,12 @@ export default async function compile(
|
||||
copyIn: { ...copyIn, [lang.code_file]: code },
|
||||
copyOutCached: [target],
|
||||
env: { HYDRO_LANG: lang.key },
|
||||
time: lang.compile_time_limit || 10000,
|
||||
memory: lang.compile_memory_limit || 256 * 1024 * 1024,
|
||||
},
|
||||
);
|
||||
if (status === STATUS.STATUS_TIME_LIMIT_EXCEEDED) next?.({ message: 'Compile timeout.' });
|
||||
if (status === STATUS.STATUS_MEMORY_LIMIT_EXCEEDED) next?.({ message: 'Compile memory limit exceeded.' });
|
||||
if (status !== STATUS.STATUS_ACCEPTED) throw new CompileError({ status, stdout, stderr });
|
||||
if (!fileIds[target]) throw new CompileError({ stderr: 'Executable file not found.' });
|
||||
next?.({ compilerText: compilerText(stdout, stderr) });
|
||||
|
||||
Reference in new issue
Block a user