core: re-fetch rdoc after postJudge to prevent race conditions

This commit is contained in:
undefined committed 2023-11-07 22:33:32 +08:00
1 parent 2691e171b5
commit d5388d91c8
1 file changed
+1
+1
View File
@@ -139,6 +139,7 @@ export async function end(body: Partial<JudgeResultBody>) {
await sleep(100); // Make sure that all 'next' event already triggered
rdoc = await record.update(rdoc.domainId, body.rid, $set, $push, $unset);
await postJudge(rdoc);
rdoc = await record.get(body.rid);
bus.broadcast('record/change', rdoc, null, null, body); // trigger a full update
}