vjudge: ensure dependencies

This commit is contained in:
undefined committed 2021-09-17 02:34:36 +08:00
1 parent 11822146e5
commit ad9501311f
3 files changed
+22 -20

No files matched your search

+1 -1
View File
@@ -140,7 +140,7 @@ class RecordDetailHandler extends Handler {
const rdoc = await record.get(domainId, rid);
if (rdoc) {
await record.reset(domainId, rid, true);
await record.judge(domainId, rid, 0);
await record.judge(domainId, rid, -10);
}
this.back();
}
+3 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/vjudge",
"version": "1.3.3",
"version": "1.3.4",
"description": "Submit problems to remote oj",
"main": "package.json",
"repository": "https://github.com/hydro-dev/Hydro.git",
@@ -10,11 +10,13 @@
"dependencies": {
"@hydrooj/utils": "workspace:*",
"jsdom": "^16.7.0",
"lodash": "^4.17.21",
"superagent": "^6.1.0",
"superagent-proxy": "^2.1.0"
},
"devDependencies": {
"@types/jsdom": "^16.2.13",
"@types/lodash": "^4.14.172",
"@types/superagent": "^4.1.12",
"@types/superagent-proxy": "^2.0.1"
}
+18 -18
View File
@@ -121,7 +121,7 @@ export default class LuoguProvider implements IBasicProvider {
const done = {};
let fail = 0;
let count = 0;
while (count < 60 && fail < 5) {
while (count < 120 && fail < 5) {
await sleep(1500);
count++;
try {
@@ -135,24 +135,24 @@ export default class LuoguProvider implements IBasicProvider {
}
logger.info('Fetched with length', JSON.stringify(body).length);
const total = flattenDeep(body.currentData.testCaseGroup).length;
logger.info(total);
logger.info(!!data.detail.judgeResult);
// TODO sorted
if (data.detail.judgeResult) {
for (const subtask of data.detail.judgeResult?.subtasks || []) {
for (const cid of Object.keys(subtask.testCases)) {
if (done[`${subtask.id}.${cid}`]) continue;
done[`${subtask.id}.${cid}`] = true;
const testcase = subtask.testCases[cid];
await next({
status: STATUS.STATUS_JUDGING,
case: {
status: STATUS_MAP[testcase.status],
time: testcase.time,
memory: testcase.memory,
message: testcase.description,
},
progress: (Object.keys(done).length / total) * 100,
});
}
for (const subtask of data.detail.judgeResult?.subtasks || []) {
for (const cid of Object.keys(subtask.testCases)) {
if (done[`${subtask.id}.${cid}`]) continue;
done[`${subtask.id}.${cid}`] = true;
const testcase = subtask.testCases[cid];
await next({
status: STATUS.STATUS_JUDGING,
case: {
status: STATUS_MAP[testcase.status],
time: testcase.time,
memory: testcase.memory,
message: testcase.description,
},
progress: (Object.keys(done).length / total) * 100,
});
}
}
if (data.status < 2) continue;