mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: bug fix
This commit is contained in:
1 parent
ac66e3d7a2
commit
f7f977293c
6 files changed
+13
-18
No files matched your search
@@ -29,12 +29,7 @@ async function runProblem(...arg: any[]) {
|
||||
{
|
||||
docId: pdoc.docId,
|
||||
rid: { $ne: null },
|
||||
uid: {
|
||||
$nin: [
|
||||
pdoc.owner,
|
||||
...system.get('rank.uidIgnore').split(',').map((i) => +i).filter((i) => i),
|
||||
],
|
||||
},
|
||||
uid: { $ne: pdoc.owner },
|
||||
},
|
||||
).count() + 99) / 100,
|
||||
);
|
||||
@@ -68,7 +63,6 @@ async function runContest(...arg: any[]) {
|
||||
const cursor = contest.getMultiStatus(tdoc.domainId, {
|
||||
docId: tdoc.docId,
|
||||
journal: { $ne: null },
|
||||
uid: { $nin: system.get('rank.uidIgnore').split(',').map((i) => +i).filter((i) => i) },
|
||||
}).sort(contest.RULES[tdoc.rule].statusSort);
|
||||
if (!await cursor.count()) return;
|
||||
const [rankedTsdocs] = await contest.RULES[tdoc.rule].ranked(tdoc, cursor);
|
||||
@@ -166,7 +160,7 @@ async function runInDomain(id: string, isSub: boolean, report: Function) {
|
||||
const tasks = [];
|
||||
async function update(uid: number, rp: number) {
|
||||
const udoc = await UserModel.getById(id, +uid);
|
||||
const $upd: any = { $set: { rp } };
|
||||
const $upd: any = { $set: { rp: Math.max(0, rp) } };
|
||||
if (udoc.hasPriv(PRIV.PRIV_USER_PROFILE)) await domain.updateUserInDomain(id, +uid, $upd);
|
||||
}
|
||||
for (const uid in udict) tasks.push(update(+uid, udict[uid] + (deltaudict[uid] || 0)));
|
||||
|
||||
Reference in new issue
Block a user