core: remove ratingHistory

This commit is contained in:
undefined committed 2021-10-10 17:08:09 +08:00
1 parent 5f527658f8
commit fb19c8073f
8 files changed
+11 -77

No files matched your search

+1 -2
View File
@@ -27,7 +27,7 @@ async function runProblem(...arg: any[]) {
pdoc.domainId, { docId: pdoc.docId, rid: { $ne: null } },
).count() + 99) / 100,
);
const p = (pdoc.difficulty || 5) / (Math.sqrt(Math.sqrt(pdoc.nAccept)) + 1);
const p = (pdoc.difficulty || 5) / (Math.sqrt(Math.sqrt(pdoc.nAccept)) + 1) / 10;
for (let page = 1; page <= nPages; page++) {
const psdocs = await problem.getMultiStatus(
pdoc.domainId, { docId: pdoc.docId, rid: { $ne: null } },
@@ -151,7 +151,6 @@ 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 } };
if (isSub) $upd.$push = { ratingHistory: 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)));