feat(remote_judger/luogu): judge status

This commit is contained in:
Baoshuo Ren 2023-03-21 12:08:05 +08:00
parent 3a0bb632b8
commit a59c8f778f
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -380,8 +380,8 @@ export default class LuoguProvider implements IBasicProvider {
let fail = 0;
let count = 0;
while (count < 180 && fail < 10) {
await sleep(1000);
while (count < 360 && fail < 10) {
await sleep(500);
count++;
try {
@ -398,7 +398,7 @@ export default class LuoguProvider implements IBasicProvider {
}
if (result.status == 204) {
await next({});
await next({ status: '[Luogu] Judging' });
continue;
}
@ -458,7 +458,22 @@ export default class LuoguProvider implements IBasicProvider {
if (!data.detail.judgeResult?.subtasks) continue;
await next({});
const finishedTestCases = Object.entries(
data.detail.judgeResult.subtasks
)
.map(o => o[1])
.reduce(
(acc: number, sub: any) =>
acc +
Object.entries(sub.testCases as any[])
.map(o => o[1])
.filter(test => test.status >= 2).length,
0
);
await next({
status: `[Luogu] Judging (${finishedTestCases} judged)`,
});
if (data.status < 2) continue;