mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +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 });
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -107,6 +108,7 @@ export class JudgeResultCallbackContext {
|
||||
const {
|
||||
$set, $push, $unset, $inc,
|
||||
} = processPayload(body);
|
||||
body.key = 'next';
|
||||
const rdoc = await record.update(domainId, rid, $set, $push, $unset, $inc);
|
||||
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);
|
||||
if (rdoc) {
|
||||
body.key = 'end';
|
||||
bus.broadcast('record/change', rdoc, null, null, body); // trigger a full update
|
||||
await JudgeResultCallbackContext.postJudge(rdoc, this);
|
||||
}
|
||||
@@ -169,6 +172,7 @@ export class JudgeResultCallbackContext {
|
||||
$set.judger = body.judger ?? 1;
|
||||
const rdoc = await record.update(domainId, rid, $set, $push, $unset);
|
||||
if (rdoc) {
|
||||
body.key = 'end';
|
||||
app.broadcast('record/change', rdoc, null, null, body); // trigger a full update
|
||||
await JudgeResultCallbackContext.postJudge(rdoc);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user