Skip to content

Commit

Permalink
Add virtual data to tally total (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaudiomv authored Sep 8, 2024
1 parent 8d25f1a commit e82172d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@ const calculateTallyData = async (roots: AggregatorRoot[]): Promise<Partial<Tall
});

const virtualRoots = await getVirtualRootsDetails(VirtualRoots);

virtualRoots.forEach((virtualRoot) => {
virtualRoot.root_server_url = virtualRoot.root_server_url.replace(/\/$/, '');
const version = JSON.parse(virtualRoot.server_info).version;
byRootServerVersions[version] = (byRootServerVersions[version] || 0) + 1;
meetingsCount += virtualRoot.num_total_meetings;
groupsCount += virtualRoot.num_groups;
areasCount += virtualRoot.num_areas;
regionsCount += virtualRoot.num_regions;
zonesCount += virtualRoot.num_zones;
});

filteredRoots.push(...virtualRoots);
return {
meetingsCount,
Expand Down

0 comments on commit e82172d

Please sign in to comment.