|
|
@ -118,19 +118,16 @@ class JudgeState extends Model { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async updateRelatedInfo(newSubmission) { |
|
|
|
async updateRelatedInfo(newSubmission) { |
|
|
|
await syzoj.utils.lock(['JudgeState::updateRelatedInfo', 'problem', this.problem_id], async () => { |
|
|
|
if (this.type === 0) { |
|
|
|
await syzoj.utils.lock(['JudgeState::updateRelatedInfo', 'user', this.user_id], async () => { |
|
|
|
await this.loadRelationships(); |
|
|
|
if (this.type === 0) { |
|
|
|
|
|
|
|
await this.loadRelationships(); |
|
|
|
// No need to await them.
|
|
|
|
await this.user.refreshSubmitInfo(); |
|
|
|
this.user.refreshSubmitInfo(); |
|
|
|
await this.user.save(); |
|
|
|
this.problem.resetSubmissionCount(); |
|
|
|
await this.problem.resetSubmissionCount(); |
|
|
|
} else if (this.type === 1) { |
|
|
|
} else if (this.type === 1) { |
|
|
|
let contest = await Contest.fromID(this.type_info); |
|
|
|
let contest = await Contest.fromID(this.type_info); |
|
|
|
await contest.newSubmission(this); |
|
|
|
await contest.newSubmission(this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async rejudge() { |
|
|
|
async rejudge() { |
|
|
|