Skip to content
This repository was archived by the owner on Nov 8, 2020. It is now read-only.

Commit 4cb5acc

Browse files
committed
针对"正在同步测试数据"增加提示
1 parent dfdf1f5 commit 4cb5acc

File tree

4 files changed

+24
-26
lines changed

4 files changed

+24
-26
lines changed

.eslintrc.js

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
root: true,
23
env: {
34
commonjs: true,
45
node: true,
@@ -14,23 +15,23 @@ module.exports = {
1415
ecmaVersion: 2018,
1516
},
1617
rules: {
17-
"indent": ["warn", 4],
18-
"no-plusplus": "off",
19-
"no-underscore-dangle": "off",
20-
"no-console": "off",
21-
"no-extend-native": "off",
22-
"no-restricted-syntax": "off",
23-
"max-classes-per-file": "off",
24-
"radix": "off",
25-
"guard-for-in": "off",
26-
"no-param-reassign": "off",
27-
"global-require": "off",
28-
"no-multi-assign": "off",
29-
"consistent-return": "off",
30-
"no-template-curly-in-string": "off",
31-
"no-return-await": "off",
32-
"prefer-destructuring": "off",
33-
"camelcase": "off",
34-
"no-shadow": "off",
18+
indent: ['warn', 4],
19+
'no-plusplus': 'off',
20+
'no-underscore-dangle': 'off',
21+
'no-console': 'off',
22+
'no-extend-native': 'off',
23+
'no-restricted-syntax': 'off',
24+
'max-classes-per-file': 'off',
25+
radix: 'off',
26+
'guard-for-in': 'off',
27+
'no-param-reassign': 'off',
28+
'global-require': 'off',
29+
'no-multi-assign': 'off',
30+
'consistent-return': 'off',
31+
'no-template-curly-in-string': 'off',
32+
'no-return-await': 'off',
33+
'prefer-destructuring': 'off',
34+
camelcase: 'off',
35+
'no-shadow': 'off',
3536
},
3637
};

judger/daemon.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const terminate = async () => {
4040
process.on('SIGINT', terminate);
4141
process.on('SIGTERM', terminate);
4242
process.on('unhandledRejection', (reason, p) => {
43-
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
43+
console.log('Unhandled Rejection at: Promise ', p);
4444
});
4545

4646
async function daemon() {

judger/hosts/vj4.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ class JudgeTask {
136136
}
137137
}
138138

139-
140139
module.exports = class AxiosInstance {
141140
constructor(config) {
142141
this.config = config;
@@ -193,6 +192,7 @@ module.exports = class AxiosInstance {
193192
async problemData(domainId, pid, savePath, retry = 3) {
194193
log.info(`Getting problem data: ${this.config.host}/${domainId}/${pid}`);
195194
await this.ensureLogin();
195+
this.next({ judge_text: '正在同步测试数据,请稍后' });
196196
const tmpFilePath = path.resolve(CACHE_DIR, `download_${this.config.host}_${domainId}_${pid}`);
197197
try {
198198
const res = await this.axios.get(

judger/sandbox/executionServer.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const fsp = fs.promises;
1212
const env = ['PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOME=/w'];
1313
const axios = Axios.create({ baseURL: EXECUTION_HOST });
1414

15-
1615
const statusMap = {
1716
'Time Limit Exceeded': status.STATUS_TIME_LIMIT_EXCEEDED,
1817
'Memory Limit Exceeded': status.STATUS_MEMORY_LIMIT_EXCEEDED,
@@ -31,14 +30,11 @@ function proc({
3130
process_limit = SYSTEM_PROCESS_LIMIT,
3231
stdin, copyIn = {}, copyOut = [], copyOutCached = [],
3332
} = {}) {
34-
for (const i in copyIn) {
35-
if (copyIn[i].src) { copyIn[i] = { content: fs.readFileSync(copyIn[i].src).toString() }; }
36-
}
3733
return {
3834
args: cmd(execute.replace(/\$\{dir\}/g, '/w')),
3935
env,
4036
files: [
41-
stdin ? { content: fs.readFileSync(stdin).toString() } : { content: '' },
37+
stdin ? { src: stdin } : { content: '' },
4238
{ name: 'stdout', max: 10240 },
4339
{ name: 'stderr', max: 10240 },
4440
],
@@ -93,7 +89,8 @@ async function run(execute, params) {
9389
const res = await axios.post('/run', body);
9490
[result] = res.data;
9591
} catch (e) {
96-
throw new SystemError('Cannot connect to sandbox service');
92+
// FIXME request body larger than maxBodyLength limit
93+
throw new SystemError('Cannot connect to sandbox service ', e.message);
9794
}
9895
// FIXME: Signalled?
9996
const ret = {

0 commit comments

Comments
 (0)