diff --git a/pages/index.js b/pages/index.js index 7fe237e..4ef2b6b 100644 --- a/pages/index.js +++ b/pages/index.js @@ -24,8 +24,6 @@ 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 diff --git a/src/functions/cronTrigger.js b/src/functions/cronTrigger.js index 43351f4..613fd39 100644 --- a/src/functions/cronTrigger.js +++ b/src/functions/cronTrigger.js @@ -53,7 +53,6 @@ export async function processCronTrigger(event) { if (!newMetadata.operational) { // try to get failed daily status first as KV read is cheaper than write const kvFailedDayStatusKey = 'h_' + monitor.id + '_' + getDate() - console.log(kvFailedDayStatusKey) const kvFailedDayStatus = await getKV(kvFailedDayStatusKey) // write if not found diff --git a/src/functions/helpers.js b/src/functions/helpers.js index fd95312..51e8ffd 100644 --- a/src/functions/helpers.js +++ b/src/functions/helpers.js @@ -69,10 +69,10 @@ export async function gcMonitors(config) { const keysForRemoval = kvState.filter(x => !monitors.includes(x)) - keysForRemoval.forEach(key => { + for (const key of keysForRemoval) { console.log('gc: deleting ' + checkKvPrefix + key) - deleteKV(checkKvPrefix + key) - }) + await deleteKV(checkKvPrefix + key) + } } export async function notifySlack(monitor, newMetadata) {