mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: bug fixes
This commit is contained in:
1 parent
fe0cd78db7
commit
5d0676a5d9
6 files changed
+17
-17
No files matched your search
@@ -223,7 +223,7 @@ class JudgeConnectionHandler extends ConnectionHandler {
|
||||
}
|
||||
|
||||
async cleanup() {
|
||||
logger.info('Judge daemon disconnected from ', this.ip);
|
||||
logger.info('Judge daemon disconnected from ', this.request.ip);
|
||||
bus.off('system/setting', this.sendLanguageConfig);
|
||||
if (this.processing) {
|
||||
await record.reset(this.processing.domainId, this.processing.rid, false);
|
||||
|
||||
@@ -435,8 +435,7 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
|
||||
pid,
|
||||
contest: { $ne: new ObjectID('0'.repeat(24)) },
|
||||
status: { $ne: [STATUS.STATUS_HACK_SUCCESSFUL, STATUS.STATUS_HACK_UNSUCCESSFUL] },
|
||||
})
|
||||
.project({ _id: 1, contest: 1 }).toArray();
|
||||
}).project({ _id: 1, contest: 1 }).toArray();
|
||||
const priority = await record.submissionPriority(this.user._id, -rdocs.length * 5 - 50);
|
||||
await Promise.all(rdocs.map(
|
||||
(doc) => record.reset(domainId, doc._id, true)
|
||||
|
||||
@@ -173,8 +173,8 @@ class RecordDetailHandler extends Handler {
|
||||
@param('rid', Types.ObjectID)
|
||||
async postRejudge(domainId: string, rid: ObjectID) {
|
||||
this.checkPerm(PERM.PERM_REJUDGE);
|
||||
if ([STATUS.STATUS_HACK_SUCCESSFUL, STATUS.STATUS_HACK_UNSUCCESSFUL].find((i) => i === this.rdoc.status)) {
|
||||
throw new ForbiddenError('Cannot rejudge hack record.');
|
||||
if ([STATUS.STATUS_HACK_SUCCESSFUL, STATUS.STATUS_HACK_UNSUCCESSFUL].includes(this.rdoc.status)) {
|
||||
throw new ForbiddenError('Cannot rejudge a hack record.');
|
||||
}
|
||||
const priority = await record.submissionPriority(this.user._id, -20);
|
||||
const isContest = this.rdoc.contest && this.rdoc.contest.toString() !== '000000000000000000000000';
|
||||
|
||||
Reference in new issue
Block a user