Handle umami errors
All checks were successful
Build and copy to prod / build-and-copy (push) Successful in 3m29s
All checks were successful
Build and copy to prod / build-and-copy (push) Successful in 3m29s
This commit is contained in:
parent
5b29791fe0
commit
7c8115b298
@ -94,5 +94,6 @@ const fetchLatest = async (cache = []) => {
|
||||
}
|
||||
|
||||
export default async function() {
|
||||
return await fetchLatest(cachedContent());
|
||||
return [];
|
||||
// return await fetchLatest(cachedContent());
|
||||
}
|
@ -10,6 +10,7 @@ export default async function(arg) {
|
||||
url.searchParams.append("startAt", 0);
|
||||
url.searchParams.append("endAt", Date.now());
|
||||
url.searchParams.append("type", "url");
|
||||
try {
|
||||
|
||||
const metrics = await EleventyFetch(url.toString(), {
|
||||
duration: '1h',
|
||||
@ -18,10 +19,14 @@ export default async function(arg) {
|
||||
headers: {
|
||||
"Authorization": `Bearer ${apiKey}`,
|
||||
"Accept": "application/json"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
return metrics.filter(metric => postRegex.test(metric.x))
|
||||
.map(({ x, y }) => ({ post: x, count: y }));
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return [];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user