Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/lib/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ export interface DomainStats {
}

export const getStats = async (): Promise<DomainStats> => {
const domainCount = await metaNamesSdk.domainRepository.count();
const ownerCount = await metaNamesSdk.domainRepository
.getOwners()
.then((owners) => owners.length);
const recentDomains = await getRecentDomains();
// ⚑ Bolt: Execute independent queries concurrently to avoid waterfall latency
const [domainCount, ownerCount, recentDomains] = await Promise.all([
metaNamesSdk.domainRepository.count(),
metaNamesSdk.domainRepository.getOwners().then((owners) => owners.length),
getRecentDomains()
]);

return {
domainCount,
Expand Down