core: optimize query speed

This commit is contained in:
undefined committed 2021-09-12 05:28:38 +08:00
1 parent f5c63e02ce
commit f1e2409991
20 files changed
+116 -147

No files matched your search

+1 -1
View File
@@ -131,7 +131,7 @@ async function runInDomain(id: string, isSub: boolean, report: Function) {
], (a, b) => a.uid === b.uid);
for (const dudoc of dudocs) deltaudict[dudoc.uid] = dudoc.rpdelta;
const contests: Tdoc<30 | 60>[] = await contest.getMulti('', { domainId, rated: true })
.sort('endAt', -1).toArray() as any;
.toArray() as any;
await report({ message: `Found ${contests.length} contests in ${id}` });
for (const i in contests) {
const tdoc = contests[i];