diff --git a/src/config.ts b/src/config.ts index 7713acf..e7f0b2c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,7 +3,7 @@ import type { Config } from './types' export const config: Config = { settings: { title: 'Status Page', - url: 'https://status-page.eidam.dev', + url: 'https://cf-worker-status-page-pro-production.yunsii.workers.dev', daysInHistogram: 90, collectResponseTimes: true, }, diff --git a/src/worker/_helpers/notifications.ts b/src/worker/_helpers/notifications.ts index b4a63d6..fa27de6 100644 --- a/src/worker/_helpers/notifications.ts +++ b/src/worker/_helpers/notifications.ts @@ -51,7 +51,7 @@ export async function notifySlack(monitor: Monitor, operational: boolean, option }, ], } - return fetch(webhook, { + return await fetch(webhook, { body: JSON.stringify(payload), method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -84,7 +84,7 @@ export async function notifyTelegram(monitor: Monitor, operational: boolean, opt payload.append('text', text) const telegramUrl = `https://api.telegram.org/bot${apiToken}/sendMessage` - return fetch(telegramUrl, { + return await fetch(telegramUrl, { body: payload, method: 'POST', }) @@ -115,7 +115,7 @@ export async function notifyDiscord(monitor: Monitor, operational: boolean, opti }, ], } - return fetch(webhook, { + return await fetch(webhook, { body: JSON.stringify(payload), method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -160,5 +160,5 @@ export function getNotifications(monitor: Monitor, monitorOperational: boolean, }) afterFetch?.() }, - ] + ].map((item) => item()) } diff --git a/src/worker/cron/index.ts b/src/worker/cron/index.ts index 3d0c0b9..d02036c 100644 --- a/src/worker/cron/index.ts +++ b/src/worker/cron/index.ts @@ -61,7 +61,6 @@ export async function handleCronTrigger(event: FetchEvent) { }) if (monitorStatusChanged) { - console.log('monitorStatusChanged to', monitorOperational) event.waitUntil(Promise.allSettled(notifications)) }