Skip to content

Commit

Permalink
Update Process.ts
Browse files Browse the repository at this point in the history
Signed-off-by: Zhu Chenrui <[email protected]>
  • Loading branch information
boomzero authored Aug 14, 2024
1 parent ff9d0cd commit c311e90
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Source/Process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,15 @@ export class Process {
}
public IfUserExistChecker = async (Username: string): Promise<Result> => {
let rst = this.IfUserExist(Username);
if (rst["Success"]) {
return rst;
}
//if failed try again
const retryCount = 20; // Define how many times you want to retry
for (let i = 0; i < retryCount; i++) {
rst = this.IfUserExist(Username);
if (rst["Success"]) {
return rst = this.IfUserExist(Username);
return rst;
}
await sleep(500);
}
Expand Down Expand Up @@ -286,11 +290,15 @@ export class Process {
}
public GetProblemScoreChecker = async (ProblemID: number): Promise<number> => {
let rst = this.GetProblemScore(ProblemID);
if (rst["Success"]) {
return rst;
}
//if failed try again
const retryCount = 20; // Define how many times you want to retry
for (let i = 0; i < retryCount; i++) {
rst = this.GetProblemScore(ProblemID);
if (rst["Success"]) {
return rst = this.GetProblemScore(ProblemID);
return rst;
}
await sleep(500);
}
Expand Down

0 comments on commit c311e90

Please sign in to comment.