judge: change sandbox memoryMax logic

This commit is contained in:
undefined committed 2021-04-20 13:41:20 +08:00
1 parent 915c01f703
commit 4710476678
3 files changed
+5 -5

No files matched your search

+1 -3
View File
@@ -26,13 +26,11 @@ const statusMap = {
function proc({
execute = '',
time = 16000,
memory = 1024,
memory = parseMemoryMB(getConfig('memoryMax')),
process_limit = 32,
stdin = '', copyIn = {}, copyOut = [], copyOutCached = [],
} = {}) {
const size = parseMemoryMB(getConfig('stdio_size'));
const memoryMax = parseMemoryMB(getConfig('memoryMax'));
if (memory > memoryMax) throw new FormatError('Memory limit larger than memory_max');
return {
args: cmd(execute.replace(/\$\{dir\}/g, '/w')),
env,