mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
vjudge: ensure dependencies
This commit is contained in:
1 parent
11822146e5
commit
ad9501311f
3 files changed
+22
-20
No files matched your search
@@ -140,7 +140,7 @@ class RecordDetailHandler extends Handler {
|
|||||||
const rdoc = await record.get(domainId, rid);
|
const rdoc = await record.get(domainId, rid);
|
||||||
if (rdoc) {
|
if (rdoc) {
|
||||||
await record.reset(domainId, rid, true);
|
await record.reset(domainId, rid, true);
|
||||||
await record.judge(domainId, rid, 0);
|
await record.judge(domainId, rid, -10);
|
||||||
}
|
}
|
||||||
this.back();
|
this.back();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/vjudge",
|
"name": "@hydrooj/vjudge",
|
||||||
"version": "1.3.3",
|
"version": "1.3.4",
|
||||||
"description": "Submit problems to remote oj",
|
"description": "Submit problems to remote oj",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
@@ -10,11 +10,13 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hydrooj/utils": "workspace:*",
|
"@hydrooj/utils": "workspace:*",
|
||||||
"jsdom": "^16.7.0",
|
"jsdom": "^16.7.0",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
"superagent": "^6.1.0",
|
"superagent": "^6.1.0",
|
||||||
"superagent-proxy": "^2.1.0"
|
"superagent-proxy": "^2.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jsdom": "^16.2.13",
|
"@types/jsdom": "^16.2.13",
|
||||||
|
"@types/lodash": "^4.14.172",
|
||||||
"@types/superagent": "^4.1.12",
|
"@types/superagent": "^4.1.12",
|
||||||
"@types/superagent-proxy": "^2.0.1"
|
"@types/superagent-proxy": "^2.0.1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ export default class LuoguProvider implements IBasicProvider {
|
|||||||
const done = {};
|
const done = {};
|
||||||
let fail = 0;
|
let fail = 0;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
while (count < 60 && fail < 5) {
|
while (count < 120 && fail < 5) {
|
||||||
await sleep(1500);
|
await sleep(1500);
|
||||||
count++;
|
count++;
|
||||||
try {
|
try {
|
||||||
@@ -135,24 +135,24 @@ export default class LuoguProvider implements IBasicProvider {
|
|||||||
}
|
}
|
||||||
logger.info('Fetched with length', JSON.stringify(body).length);
|
logger.info('Fetched with length', JSON.stringify(body).length);
|
||||||
const total = flattenDeep(body.currentData.testCaseGroup).length;
|
const total = flattenDeep(body.currentData.testCaseGroup).length;
|
||||||
|
logger.info(total);
|
||||||
|
logger.info(!!data.detail.judgeResult);
|
||||||
// TODO sorted
|
// TODO sorted
|
||||||
if (data.detail.judgeResult) {
|
for (const subtask of data.detail.judgeResult?.subtasks || []) {
|
||||||
for (const subtask of data.detail.judgeResult?.subtasks || []) {
|
for (const cid of Object.keys(subtask.testCases)) {
|
||||||
for (const cid of Object.keys(subtask.testCases)) {
|
if (done[`${subtask.id}.${cid}`]) continue;
|
||||||
if (done[`${subtask.id}.${cid}`]) continue;
|
done[`${subtask.id}.${cid}`] = true;
|
||||||
done[`${subtask.id}.${cid}`] = true;
|
const testcase = subtask.testCases[cid];
|
||||||
const testcase = subtask.testCases[cid];
|
await next({
|
||||||
await next({
|
status: STATUS.STATUS_JUDGING,
|
||||||
status: STATUS.STATUS_JUDGING,
|
case: {
|
||||||
case: {
|
status: STATUS_MAP[testcase.status],
|
||||||
status: STATUS_MAP[testcase.status],
|
time: testcase.time,
|
||||||
time: testcase.time,
|
memory: testcase.memory,
|
||||||
memory: testcase.memory,
|
message: testcase.description,
|
||||||
message: testcase.description,
|
},
|
||||||
},
|
progress: (Object.keys(done).length / total) * 100,
|
||||||
progress: (Object.keys(done).length / total) * 100,
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data.status < 2) continue;
|
if (data.status < 2) continue;
|
||||||
|
|||||||
Reference in new issue
Block a user