mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: re-fetch rdoc after postJudge to prevent race conditions
This commit is contained in:
1 file changed
+1
@@ -139,6 +139,7 @@ export async function end(body: Partial<JudgeResultBody>) {
|
|||||||
await sleep(100); // Make sure that all 'next' event already triggered
|
await sleep(100); // Make sure that all 'next' event already triggered
|
||||||
rdoc = await record.update(rdoc.domainId, body.rid, $set, $push, $unset);
|
rdoc = await record.update(rdoc.domainId, body.rid, $set, $push, $unset);
|
||||||
await postJudge(rdoc);
|
await postJudge(rdoc);
|
||||||
|
rdoc = await record.get(body.rid);
|
||||||
bus.broadcast('record/change', rdoc, null, null, body); // trigger a full update
|
bus.broadcast('record/change', rdoc, null, null, body); // trigger a full update
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user