From 70669fbf48ba504e2b69cd2defd64ff01c027189 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 20 Mar 2023 11:32:06 +0800 Subject: [PATCH] fix(remote_judger/qoj): add retry --- remote_judger/src/providers/qoj.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/remote_judger/src/providers/qoj.ts b/remote_judger/src/providers/qoj.ts index cb06594..8d5578b 100644 --- a/remote_judger/src/providers/qoj.ts +++ b/remote_judger/src/providers/qoj.ts @@ -215,7 +215,7 @@ export default class QOJProvider extends UOJProvider implements IBasicProvider { const { text: status } = await this.get( `/submissions?problem_id=${id}&submitter=${this.account.handle}` - ); + ).retry(3); const $dom = new JSDOM(status); @@ -228,12 +228,12 @@ export default class QOJProvider extends UOJProvider implements IBasicProvider { let count = 0; let fail = 0; - while (count < 180 && fail < 10) { + while (count < 180 && fail < 60) { count++; await sleep(1000); try { - const { text } = await this.get(`/submission/${id}`); + const { text } = await this.get(`/submission/${id}`).retry(3); const { window: { document }, } = new JSDOM(text);