core: handle sync delay in database cluster

This commit is contained in:
undefined committed 2025-10-03 18:36:16 +08:00
1 parent fb4ff1c196
commit fe437740d5
4 files changed
+16 -12

No files matched your search

+4 -4
View File
@@ -925,14 +925,14 @@ export class ProblemSolutionHandler extends ProblemDetailHandler {
@param('psid', Types.ObjectId)
async postUpvote(domainId: string, psid: ObjectId) {
const [psdoc, pssdoc] = await solution.vote(domainId, psid, this.user._id, 1);
this.back({ vote: psdoc.vote, user_vote: pssdoc.vote });
const psdoc = await solution.vote(domainId, psid, this.user._id, 1);
this.back({ vote: psdoc.vote, user_vote: 1 });
}
@param('psid', Types.ObjectId)
async postDownvote(domainId: string, psid: ObjectId) {
const [psdoc, pssdoc] = await solution.vote(domainId, psid, this.user._id, -1);
this.back({ vote: psdoc.vote, user_vote: pssdoc.vote });
const psdoc = await solution.vote(domainId, psid, this.user._id, -1);
this.back({ vote: psdoc.vote, user_vote: -1 });
}
}