|
|
@ -133,13 +133,15 @@ export default class JudgeState extends Model { |
|
|
|
if (this.type === 0) { |
|
|
|
if (this.type === 0) { |
|
|
|
await this.loadRelationships(); |
|
|
|
await this.loadRelationships(); |
|
|
|
|
|
|
|
|
|
|
|
// No need to await them.
|
|
|
|
const promises = []; |
|
|
|
this.user.refreshSubmitInfo(); |
|
|
|
promises.push(this.user.refreshSubmitInfo()); |
|
|
|
this.problem.resetSubmissionCount(); |
|
|
|
promises.push(this.problem.resetSubmissionCount()); |
|
|
|
|
|
|
|
|
|
|
|
if (!newSubmission) { |
|
|
|
if (!newSubmission) { |
|
|
|
this.problem.updateStatistics(this.user_id); |
|
|
|
promises.push(this.problem.updateStatistics(this.user_id)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await Promise.all(promises); |
|
|
|
} else if (this.type === 1) { |
|
|
|
} else if (this.type === 1) { |
|
|
|
let contest = await Contest.findById(this.type_info); |
|
|
|
let contest = await Contest.findById(this.type_info); |
|
|
|
await contest.newSubmission(this); |
|
|
|
await contest.newSubmission(this); |
|
|
|