mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: judge: ensure judge event key
This commit is contained in:
1 file changed
+4
@@ -99,6 +99,7 @@ export class JudgeResultCallbackContext {
|
|||||||
}, { upsert: true });
|
}, { upsert: true });
|
||||||
} else {
|
} else {
|
||||||
const rdoc = await record.update(this.task.domainId, new ObjectId(this.task.rid as string), $set, $push, $unset, $inc);
|
const rdoc = await record.update(this.task.domainId, new ObjectId(this.task.rid as string), $set, $push, $unset, $inc);
|
||||||
|
body.key = 'next';
|
||||||
if (rdoc) this.ctx.broadcast('record/change', rdoc, $set, $push, body);
|
if (rdoc) this.ctx.broadcast('record/change', rdoc, $set, $push, body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -107,6 +108,7 @@ export class JudgeResultCallbackContext {
|
|||||||
const {
|
const {
|
||||||
$set, $push, $unset, $inc,
|
$set, $push, $unset, $inc,
|
||||||
} = processPayload(body);
|
} = processPayload(body);
|
||||||
|
body.key = 'next';
|
||||||
const rdoc = await record.update(domainId, rid, $set, $push, $unset, $inc);
|
const rdoc = await record.update(domainId, rid, $set, $push, $unset, $inc);
|
||||||
if (rdoc) app.broadcast('record/change', rdoc, $set, $push, body);
|
if (rdoc) app.broadcast('record/change', rdoc, $set, $push, body);
|
||||||
}
|
}
|
||||||
@@ -156,6 +158,7 @@ export class JudgeResultCallbackContext {
|
|||||||
|
|
||||||
const rdoc = await record.update(this.task.domainId, new ObjectId(this.task.rid as string), $set, $push, $unset);
|
const rdoc = await record.update(this.task.domainId, new ObjectId(this.task.rid as string), $set, $push, $unset);
|
||||||
if (rdoc) {
|
if (rdoc) {
|
||||||
|
body.key = 'end';
|
||||||
bus.broadcast('record/change', rdoc, null, null, body); // trigger a full update
|
bus.broadcast('record/change', rdoc, null, null, body); // trigger a full update
|
||||||
await JudgeResultCallbackContext.postJudge(rdoc, this);
|
await JudgeResultCallbackContext.postJudge(rdoc, this);
|
||||||
}
|
}
|
||||||
@@ -169,6 +172,7 @@ export class JudgeResultCallbackContext {
|
|||||||
$set.judger = body.judger ?? 1;
|
$set.judger = body.judger ?? 1;
|
||||||
const rdoc = await record.update(domainId, rid, $set, $push, $unset);
|
const rdoc = await record.update(domainId, rid, $set, $push, $unset);
|
||||||
if (rdoc) {
|
if (rdoc) {
|
||||||
|
body.key = 'end';
|
||||||
app.broadcast('record/change', rdoc, null, null, body); // trigger a full update
|
app.broadcast('record/change', rdoc, null, null, body); // trigger a full update
|
||||||
await JudgeResultCallbackContext.postJudge(rdoc);
|
await JudgeResultCallbackContext.postJudge(rdoc);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user