mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 17:38:19 +08:00
core: rating: ignore invalid user
This commit is contained in:
1 parent
aac478f787
commit
f18547ba16
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.1.27",
|
||||
"version": "3.1.28",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -160,7 +160,7 @@ async function runInDomain(id: string, isSub: boolean, report: Function) {
|
||||
async function update(uid: number, rp: number) {
|
||||
const udoc = await UserModel.getById(id, +uid);
|
||||
const $upd: any = { $set: { rp: Math.max(0, rp) } };
|
||||
if (udoc.hasPriv(PRIV.PRIV_USER_PROFILE)) await domain.updateUserInDomain(id, +uid, $upd);
|
||||
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)));
|
||||
await Promise.all(tasks);
|
||||
|
||||
Reference in new issue
Block a user