judge: fix

This commit is contained in:
undefined committed 2021-06-12 23:58:33 +08:00
1 parent a24c724fb7
commit 4da505a955
3 files changed
+7 -7

No files matched your search

+4 -4
View File
@@ -95,9 +95,9 @@ export async function runMultiple(execute) {
body.cmd[1].files[0] = null;
body.cmd[1].files[1] = null;
const id = callId++;
if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(body));
if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(body));
res = await Axios.create({ baseURL: getConfig('sandbox_host') }).post('/run', body);
if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(res.data));
if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(res.data));
} catch (e) {
if (e instanceof FormatError) throw e;
throw new SystemError('Sandbox Error');
@@ -123,9 +123,9 @@ export async function run(execute, params?) {
}
const body = { cmd: [proc({ execute, ...params })] };
const id = callId++;
if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(body));
if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(body));
const res = await Axios.create({ baseURL: getConfig('sandbox_host') }).post('/run', body);
if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(res.data));
if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(res.data));
[result] = res.data;
} catch (e) {
if (e instanceof FormatError) throw e;