mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +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",
|
||||
"version": "1.3.4",
|
||||
"version": "1.3.5",
|
||||
"description": "Submit problems to remote oj",
|
||||
"main": "package.json",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -121,6 +121,7 @@ export default class LuoguProvider implements IBasicProvider {
|
||||
const done = {};
|
||||
let fail = 0;
|
||||
let count = 0;
|
||||
let finished = 0;
|
||||
while (count < 120 && fail < 5) {
|
||||
await sleep(1500);
|
||||
count++;
|
||||
@@ -135,12 +136,11 @@ 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
|
||||
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;
|
||||
finished++;
|
||||
done[`${subtask.id}.${cid}`] = true;
|
||||
const testcase = subtask.testCases[cid];
|
||||
await next({
|
||||
@@ -151,7 +151,7 @@ export default class LuoguProvider implements IBasicProvider {
|
||||
memory: testcase.memory,
|
||||
message: testcase.description,
|
||||
},
|
||||
progress: (Object.keys(done).length / total) * 100,
|
||||
progress: (finished / total) * 100,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user