core: rating: reset before upgrade

This commit is contained in:
undefined committed 2023-01-28 21:13:18 +08:00
1 parent 25ab36b2e6
commit 4f9c1a03f2
2 files changed
+3 -2

No files matched your search

+1
View File
@@ -137,6 +137,7 @@ async function runInDomain(domainId: string, report: Function) {
const domainIds = [domainId, ...(info.union || [])];
const results: Record<keyof typeof RpTypes, ND> = {};
const udict = Counter();
await db.collection('domain.user').updateMany({ domainId }, { $set: { rpInfo: {} } });
for (const type in RpTypes) {
results[type] = new Proxy({}, { get: (self, key) => self[key] || RpTypes[type].base });
await RpTypes[type].run(domainIds, results[type], report);