1
0
mirror of https://github.com/tormachris/cf-workers-status-page.git synced 2025-09-21 16:35:15 +02:00

feat: optimize KV storage read/write operations

- the state is now stored in a single KV key
- there is one write for cron and one read for render
This commit is contained in:
Adam Janis
2020-11-19 18:43:33 +01:00
parent 293dff9425
commit c5b9232eb2
7 changed files with 71 additions and 133 deletions

View File

@ -1,11 +1,11 @@
import config from '../../config.yaml'
export default function MonitorStatusLabel({ kvMonitorsMap, monitor }) {
export default function MonitorStatusLabel({ kvMonitor }) {
let labelColor = 'grey'
let labelText = 'No data'
if (typeof kvMonitorsMap[monitor.id] !== 'undefined') {
if (kvMonitorsMap[monitor.id].operational) {
if (typeof kvMonitor !== 'undefined') {
if (kvMonitor.operational) {
labelColor = 'green'
labelText = config.settings.monitorLabelOperational
} else {