mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 17:46:28 +08:00
core: handle sync delay in database cluster
This commit is contained in:
4 files changed
+16
-12
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user