fix heartbeat stats

This commit is contained in:
Andrea Vos 2022-09-07 18:14:23 +02:00
parent 17236cceac
commit 88b53381ae

View File

@ -85,8 +85,9 @@ module.exports.calculateStats = async (db, allLocales) => {
let heartbeat = {};
try {
for (let pageStats of Object.values((await (await fetch(`${process.env.HEARTBEAT_LINK}/30d.json`)).json()).pages)) {
heartbeat[pageStats.url] = {
for (let [page, pageStats] of Object.entries((await (await fetch(`${process.env.HEARTBEAT_LINK}/30d.json`)).json()).pages)) {
if (page.startsWith('dns-')) { continue; }
heartbeat[`https://${page}`] = {
uptime: pageStats.uptime,
avgResponseTime: pageStats.avgResponseTime,
};