1
0
mirror of https://github.com/tormachris/cf-workers-status-page.git synced 2025-07-04 19:12:48 +02:00

chore(perf): save only failed days to KV storage

This commit is contained in:
Adam Janis
2020-11-12 18:57:42 +01:00
parent c3af9db11a
commit 541bdace4b
6 changed files with 88 additions and 89 deletions

View File

@ -24,6 +24,8 @@ export async function getEdgeProps() {
if (x.metadata.operational === false) monitorsOperational = false
})
console.log(JSON.stringify(kvMonitorsMap))
// transform KV list to array of failed days
const kvMonitorsFailedDaysArray = kvMonitorsFailedDays.map(x => {
return x.name
@ -79,9 +81,13 @@ export default function Index({
? config.settings.allmonitorsOperational
: config.settings.notAllmonitorsOperational}
</div>
<div className="black-text">
checked {Math.round((Date.now() - kvLastUpdate) / 1000)} sec ago
</div>
{typeof window !== 'undefined' ? (
<div className="black-text">
checked {Math.round((Date.now() - kvLastUpdate) / 1000)} sec ago
</div>
) : (
''
)}
</div>
</div>
{config.monitors.map((monitor, key) => {