mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
vjudge: luogu: add finished count
This commit is contained in:
1 parent
9178e5e846
commit
267b792587
2 files changed
+5
-5
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/vjudge",
|
"name": "@hydrooj/vjudge",
|
||||||
"version": "1.3.4",
|
"version": "1.3.5",
|
||||||
"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",
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ export default class LuoguProvider implements IBasicProvider {
|
|||||||
const done = {};
|
const done = {};
|
||||||
let fail = 0;
|
let fail = 0;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
let finished = 0;
|
||||||
while (count < 120 && fail < 5) {
|
while (count < 120 && fail < 5) {
|
||||||
await sleep(1500);
|
await sleep(1500);
|
||||||
count++;
|
count++;
|
||||||
@@ -135,12 +136,11 @@ 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
|
||||||
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 in subtask.testCases || {}) {
|
||||||
if (done[`${subtask.id}.${cid}`]) continue;
|
if (done[`${subtask.id}.${cid}`]) continue;
|
||||||
|
finished++;
|
||||||
done[`${subtask.id}.${cid}`] = true;
|
done[`${subtask.id}.${cid}`] = true;
|
||||||
const testcase = subtask.testCases[cid];
|
const testcase = subtask.testCases[cid];
|
||||||
await next({
|
await next({
|
||||||
@@ -151,7 +151,7 @@ export default class LuoguProvider implements IBasicProvider {
|
|||||||
memory: testcase.memory,
|
memory: testcase.memory,
|
||||||
message: testcase.description,
|
message: testcase.description,
|
||||||
},
|
},
|
||||||
progress: (Object.keys(done).length / total) * 100,
|
progress: (finished / total) * 100,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user