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

+3 -6
View File
@@ -78,12 +78,9 @@ class SolutionModel {
);
let inc = value;
if (before?.vote) inc -= before.vote;
return [
inc
? await document.inc(domainId, document.TYPE_PROBLEM_SOLUTION, psid, 'vote', inc)
: doc,
await document.getStatus(domainId, document.TYPE_PROBLEM_SOLUTION, psid, uid),
];
return inc
? await document.inc(domainId, document.TYPE_PROBLEM_SOLUTION, psid, 'vote', inc)
: doc;
}
static async getListStatus(domainId: string, psids: ObjectId[], uid: number) {