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

pull/550/merge
undefined 11 months ago
parent 2691e171b5
commit d5388d91c8
No known key found for this signature in database

@ -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
}

Loading…
Cancel
Save