Skip to content

Commit

Permalink
[Release] Release 3.30.27
Browse files Browse the repository at this point in the history
Add time limit for ujudge submission collector
  • Loading branch information
ryanlee2014 committed Jan 9, 2024
1 parent ac8b6d7 commit 60baa9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "CUP-Online-Judge-BackEnd",
"author": "Ryan Lee <[email protected]>",
"homepage": "https://github.com/ryanlee2014",
"version": "3.30.26",
"version": "3.30.27",
"engines": {
"node": ">=12.0.0"
},
Expand Down
5 changes: 3 additions & 2 deletions src/module/judger/UnjudgedSubmissionCollector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ class UnjudgedSubmissionCollector {
this.collectFinished = false;
const today = dayjs();
const yesterday = today.subtract(1, "day").format("YYYY-MM-DD HH:mm:ss");
const thirtySecondAgo = today.subtract(30, "second").format("YYYY-MM-DD HH:mm:ss")
const noDataProblemIdList = Array.from(this.noDataProblemIdSet);
const waitingResult = await MySQLManager.execQuery("SELECT solution_id,user_id FROM solution WHERE result=0 and language not in (15,22) and problem_id != 0 and in_date > '" + yesterday +"' and problem_id not in (?) order by solution_id limit ?", [noDataProblemIdList, ConfigManager.getConfig("submission_collect_limit", SUBMISSION_COLLECT_LIMIT)]);
const rejudgeResult = await MySQLManager.execQuery("SELECT solution_id,user_id FROM solution WHERE result=1 and language not in (15,22) and problem_id != 0 and in_date > '" + yesterday +"' and problem_id not in (?) order by solution_id limit ?", [noDataProblemIdList, ConfigManager.getConfig("submission_collect_limit", SUBMISSION_COLLECT_LIMIT)]);
const waitingResult = await MySQLManager.execQuery("SELECT solution_id,user_id FROM solution WHERE result=0 and language not in (15,22) and problem_id != 0 and in_date > '" + yesterday +"' and in_date < '" + thirtySecondAgo +"' and problem_id not in (?) order by solution_id limit ?", [noDataProblemIdList, ConfigManager.getConfig("submission_collect_limit", SUBMISSION_COLLECT_LIMIT)]);
const rejudgeResult = await MySQLManager.execQuery("SELECT solution_id,user_id FROM solution WHERE result=1 and language not in (15,22) and problem_id != 0 and in_date > '" + yesterday +"' and in_date < '" + thirtySecondAgo +"' and problem_id not in (?) order by solution_id limit ?", [noDataProblemIdList, ConfigManager.getConfig("submission_collect_limit", SUBMISSION_COLLECT_LIMIT)]);
const result = [...waitingResult, ...rejudgeResult];
await wait(2000);
for (let i in result) {
Expand Down

0 comments on commit 60baa9b

Please sign in to comment.